Reputation: 674
This may be asking too much, but here goes...
I have a single page web application with dynamic content -- charts and maps (from other servers) in div tags, and so on. I would like to generate a PDF from this page, such that it reflects the page's current state.
I know I can reproduce the contents of the page in a separate html page and feed that into a PDF generator, but I was hoping for a less labor intensive way. To this end, are there any PDF libraries that can walk the DOM and construct a PDF page?
EDIT
I know of similar questions on this site, but none of the answers solved them; rather, each answer required reconstructing the page prior to sending it to PDF. The problem is I have a single page web application and would like to avoid doing that or re-architecting my application just so I can get PDF printing.
Upvotes: 0
Views: 424
Reputation: 8877
cloudformatter.com/CSS2Pdf is Javascript that walks the browser DOM, extracts it and cleans it up abit and sends to a remote server for formatting. The remotes server uses XSL to convert the XML obtained from the DOM to XSL FO and onto PDF (or any other supported format).
As you are now looking for Fusioncharts and Google maps, post a question in the Stackoverflow group css-to-pdf. The team and I would be happy to examine. We know Fusioncharts pretty well, surprised we did not test that one. Google Maps is a whole different animal usually killed from cross-site scripting but we can look at it.
Upvotes: 2