top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to save specific html portion into pdf using asp.net?

+3 votes
494 views

I want to save specific html portion into pdf using asp.net into MS SQL SERVER 2008. I know it will done will itextsharp.dll library file from .NET conversion but tell me through example.

posted Dec 4, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote
 
Best answer

See if this helps

Document document = new Document();
PdfWriter.GetInstance(document, new FileStream(Request.PhysicalApplicationPath + "\\MySamplePDF.pdf", FileMode.Create));
document.Open();
iTextSharp.text.html.simpleparser.HTMLWorker hw = 
             new iTextSharp.text.html.simpleparser.HTMLWorker(document);
hw.Parse(new StringReader(htmlText));
document.Close();

Also see the following blogs may be helpful
http://hspinfo.wordpress.com/2008/01/12/how-to-convert-html-content-to-pdf-file/

answer Dec 5, 2013 by Luv Kumar
Similar Questions
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...