Click here to Skip to main content
11,706,979 members (46,794 online)
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 Sergey Alexandrovich Kryukov 140
1 OriginalGriff 125
2 chainerlt 110
3 ppolymorphe 89
4 Mika Wendelius 70
0 OriginalGriff 9,178
1 Sergey Alexandrovich Kryukov 8,487
2 CPallini 5,189
3 Maciej Los 4,766
4 Mika Wendelius 3,696


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100