Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 4-Feb-13 18:46pm
Comments

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
__TR__ at 5-Feb-13 7:43am
   
5ed!
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 Maciej Los 295
1 OriginalGriff 278
2 Nguyen.H.H.Dang 230
3 Peter Leow 195
4 arvind mepani 187


Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid