Sorry - I didn't see a single dynamic HTML to PDF converter there. I only saw static ones that, while converting form data, would not convert current form input. Most of them rely on the script loading the page dynamically over HTTP, which invalidates form input. Or running through a loaded "source" and rendering each element - also not sufficient as it doesn't ever touch the values of the current page.
Download the Asp form in pdf format
Collapse
X
-
-
"start a browser with the URL and make a screenshot"
I say bad idea if you want it to look like a proper screenshot. Particularly Linux has issues with rendering the same as, for instance, a client running under a Windows enviroment, let alone cross-browser problems.
I still think it's easier to just render the HTML into a javascript array, particularly since the fonts will be known in advance. And the output would be better. But it might be slower (although you could pre-render most of the form). You could also provide status feedback.
PNG is also a silly format. Use bitmaps cause they're easy to manipulate (no compression).
PDFing is, I repeat, a slow process that should NEVER be attempted with javascript unless you are actually god. Even on intranets. Which really begs the question - why are we still discussing this? Sorry.
"with JavaScript you can! create documents" ... elaborate, please - I'm fascinated... can this be used to create a persistent database somehow? (I know that's off topic but I've never even thought of the concept...)
just to say that i'm quite disappointed by such ignorance and plain thinking only in ONE way i'm out of this discussion here ... certainly i don't know of what i speak ... and i bow low to such straight wisdom ...Comment
-
Confused as to the way this thread went.
Bad solution: there are commercial applications which allow you to flash/watermark images onto an existing pdf. You could dynamically create the images based on the user input and flash them accordingly.
Better(?) Clicking a button submits the form to the server. Based on the user response, the server generates an xml file, with the user data, which is merged with the form with xslt & xsl-fo giving pdf.
Need to find/configure the correct xsl-fo converter to work with your app
Need to be able to convert the form into the correct base xml.
There's probably better ways not using xslt, but that's what I know.
====
edit:
On the off chance we're looking for something silly like this:
Paste the screen shot into a word doc.
Use a word-pdf converter online, or buy the commercial version.Comment
-
I do apologize for still trying to think in purely javascript terms. It just occurred to me that another easy way would be regenerating a new page with the initial values of the form set to the current values of the form and then sending this HTML code to a server-side script which processes it into a PDF. Again sorry for my over-complication.Comment
Comment