Last post Feb 17, 2011 09:19 AM by mrfixit3000
Feb 15, 2011 05:06 PM|mrfixit3000|LINK
Ok, so after a bunch of research and trial and error I'm posting for some help. Fairly simple, I have an ASP page that displays an HTML form. I need to convert this form into a PDF programatically. I do not need the resulting PDF to be a form, it just needs
to look exactly like the HTML form, complete with values. The form contains radio buttons, textboxes, and checkboxes.
I've written code using the iTextSharp library, but the resulting PDF does not display any of the form fields and the table spacing and structure is no longer correct.
ANY suggestions would be extremely appreciated. Thanks!
Feb 17, 2011 01:08 AM|anfran.mendez|LINK
I had done this a couple of years back. But it was XHTML to XSL-FO via XSLT, and then FO to PDF.
The XSL file which will do the transformation is freely available. Just google and find it. The next step is the conversion of XHTML to XSL-FO with this available XSL file. Then convert this FO file to PDF with any third party components . I think APACHE
FOP is a free component for this purpose.
Feb 17, 2011 09:18 AM|mrfixit3000|LINK
Thanks for the response. I kept plugging away at this project after I posted for help and I was able to find an alternative. I figured out how to use the DrawToBitmap method of the .NET WebBrowser control to generate an image, then I split the image into
an array of images that are the size of each page, and then I used iTextSharp to insert the resulting images into a new PDF.
Feb 17, 2011 09:19 AM|mrfixit3000|LINK
But since you are the only one that bothered responding, and I'm sure your method probably would work, I'll give you credit as the answer.