Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to convert from HTML to PDF in asp.net.I called one HTML file from local server and load on a "div" control.This HTMl format contains some controls like Textbox,checkbox and object.when convert to PDF format i want to display these controls also in PDF.but i need to do without any(PDF conversion s/w).anybody knows this..share to me......
Posted
Comments

1 solution

First of all, as there is no one-to-one correspondence between HTML and PDF, and the approaches in these formats are different, on input, you need not just some HTML, but also some mapping rules of your choice.

Ideally, HTML should be a well-formed XML, then you could use any of the XML parsers available in FCL. If you cannot assume well-formed XML, this is much worse: you would need some HTML parser which could cope with that. I would advise, for example, this one: http://www.majestic12.co.uk/projects/html_parser.php[^].

To produce PDF, you can really use the .NET port of iText; this port is called iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

I provided links to iText, too, because nearly all documentation you need to work with iTextSharp is there, provided as Java documentation.

—SA
 
Share this answer
 
Comments
__TR__ 5-Feb-13 7:43am    
5ed!
Sergey Alexandrovich Kryukov 5-Feb-13 11:48am    
Thank you,
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900