The reason the map cannot be captured is that products that capture HTML or ASP pages typically do so upon the start of the page's ONLOAD event which fires when the rendering of the HTML components of a page has been completed. In cases of web pages that are constructed to display maps from MapQuest, Yahoo, and Google, the code that requests the creation of the map does not occur until the ONLOAD event has already fired. A small delay occurs, and the innerHTML property of the HTML tag that was designated in the call to the mapping API is replaced with the data that is streamed to the callback function on the same page.
Since the PDF capture software does its work using the state of the page before the request to deliver the mapping data has been made, the maps never show up in the resultant PDF file.
I have been working on the same problem, and I have taken a variety of approaches, but none of them can succeed unless a downloadable ActiveX component is added to the page. The purpose of the component would be to capture the image after it is drawn, save it as as graphic file, and then build a document containing the graphic to be stiched into the target PDF. Needless to say, this kind of programming is complex, prone to error, and usually takes a MUCH LONGER time than originally anticipated.
If I find a way to do this, I'll let you know.
Quote:
Originally Posted by cesarcesar I have a HTML page that is dynamically built. Within the page is a Google Map. The page is called and processed to output as a PDF using a PDF generation class. My problem is that when the PDF completes it is missing the map.
My question is, how or what program (open source or not) can i use to get the map to show. Currently the PDF class im using is http://www.tufat.com/s_html2ps_html2pdf.htm. It is so far the best i have found. It will not capture Flash/AJAX Google, MapQuest, or Yahoo Maps. It will though capture the non-javascript version of Yahoo Maps. I have looked and cannot find an API for this older style map. If anyone has an idea, please send along. I have also tried these PDF programs, http://www.ros.co.nz/pdf/, http://www.fpdf.org/.
Alternatively, i would also like to know if there are any suggestions on PHP scripts/programs that will fill data into a MS Word doc, or generate a Word doc like a PDF. Similar to how Access can.
Thanks Much |