Download the Asp form in pdf format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • larztheloser
    New Member
    • Jan 2010
    • 86

    #16
    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.

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #17
      "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.
      the OP has the problem to have a screenshot for HIS/HER page ... so he KNOWS how the page should render ... so it just needs to be a target browser that would render HIS/HER page properly ... so the crossbrowser argument is just no argument in that case ...

      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.
      whatfor should that be good? what should a JavaScript array do here? even an array wouldn't provide any sufficient structure for a document-tree ... while a JSON structure (basicly a string representation of a JavaScript Object) would be ... that object could be transfered to the server to use it as a base for 'PDFing'

      PNG is also a silly format. Use bitmaps cause they're easy to manipulate (no compression).
      when you ever have read the above linked 'canvas-screenshot'-EXAMPLE which shows ONE way to achieve something what the OP wants ... you might guess with your neverending wisdom that it seems quite tricky for a browser to create images that are not really 'webaware' what a bmp wouldn't be?

      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.
      nobody is discussing 'PDFing' at the client ... like these words: 'which will create an image that you might upload' ... might show?

      "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...)
      what about creating elements - so you could create entire xml-docs that just needs to be transfered to the server via a request ... the document IS created in memory of course ... but it is present ... you could add it to a new window or whatever ... when it is sent to the server in that current state ... this could be saved there and thus the document is then persistent THERE.

      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

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #18
        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

        • larztheloser
          New Member
          • Jan 2010
          • 86

          #19
          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

          Working...