HTML to PDF using iTextSharp Library In ASP.NET

You may also like...

33 Responses

  1. Fidel says:

    Hi there, just became alert to your blog through Google, and found that it is truly informative.
    I’m going to watch out for brussels. I’ll appreciate if you continue this in future.
    Lots of people will be benefited from your writing.

  2. Alisha says:

    Usually I don’t read post on blogs, however I wish to say that this write-up very pressured me to
    check out and do so! Your writing taste has been surprised me.
    Thank you, quite great post.

  3. noroozi says:

    when I add Unicode characters like “فق” pdf file don’t show this characters.
    maybe cant render this characters.

  4. Joxin says:

    Thank you for this article. This helped me.

  5. mehmet can says:

    Hi there, your code works perfect but some character does not appear on pdf. For example turkish character(ş,iö,ğ,ü). Can you help me?

  6. amit says:

    how to add hindi unicode in pdf for unicode font print anf if we use table how to repeat table header

  7. bhushan says:

    i am getting error for following

    GeneratePDF.HtmlToPdfBuilder builder = new GeneratePDF.HtmlToPdfBuilder(iTextSharp.text.PageSize.A4);
    GeneratePDF.HtmlPdfPage first = builder.AddPage();

    • Admin says:

      Share your error message with us.

      • saimanisha says:

        even iam getting the same error
        GeneratePDF.HtmlToPdfBuilder builder = new GeneratePDF.HtmlToPdfBuilder(iTextSharp.text.PageSize.A4);
        GeneratePDF.HtmlPdfPage first = builder.AddPage()
        what is there in GeneratePDF class

  8. bhushan says:

    got error while open pdf file
    “either not supported file or it will be a attached file”

  9. Deekshit says:

    Hi, I am getting an error stating
    “Error 4 The name ‘Markup’ does not exist in the current context C:\Proj\WebApplication1\WebApplication1\GeneratePDF.cs 198 41 WebApplication1″

    Please help.

  10. manikandan says:

    I am getting the same error in generatepdf method, i have added the two dll eventhough I’m getting pls help me

  11. nadeem says:

    Great article.

  12. sunil says:

    Not working for unicoded text like हिंदी ?? How to overcome this issue ?

  13. Chandra Shekar says:

    Your Code is working perfectly, But is not supporting CSS styles and images for me ..can u help me out

  14. Tarun Jain says:

    Hello author..!!
    I’d like to know what is dvHtml,due to this class error occur “dvHtml keyword doesn’t exist in project ”
    Please Help me out ASAP..
    Thanks in advanced.

  15. Jonathan says:

    Guys I’m getting Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors() while importing my HTML code , the exception seems to be triggered by this function. RenderControl(hw); Do you have a clue about how to sort this out. There are a lot of info within the Web but nothing works.
    Thanks in advance.

  16. valli says:

    is possible to add header that should repeat in all the pages of pdf?

  17. Naveed says:

    How to Convert/Export an ASPX page with texboxes and other controls(Checkbox,Radio buttons etc) to PDF using itextsharp

    Can any one help?

  18. Ajeeth Kapoor says:


    You make learning and reading addictive. All eyes fixed on you. Thank you being such a good and trust worthy guide.

    I have this Splitter. Which have first pane 25% width. In first pane is grid which i want 100% width and height. But on page load the first pane have width 100% and in this time the grid is rendered. Then the pane shrink to the 25% but the grid do not refresh his size. After i do some resize with page the grid refresh well. Also please how to add 100% height for the grid? Pictures attached ASP .Net

    But great job man, do keep posted with the new updates.

    Best Regards,

  19. Valentina Nelson says:

    Thanx for sharing it….You can also used zetpdf to convert Html to PDF. I am using it and experience of using it is awesome…

  20. bornHye says:

    converting html to pdf using another third part library in c#

  21. promis patel says:

    Its not working when using textbox and checkbox in file

Leave a Reply to Admin Cancel reply

Your email address will not be published. Required fields are marked *

− 4 = three

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">