asp.net create pdf RRS feed

  • Question

  • User1472402676 posted


    I am search the net for create a pdf i found iTextSharp .dll.

    Using PdfPTable we can create a table in pdf.

    but my problem is i have table in (Web.UI.HtmlControls.HtmlTable) 

    Any way to convert HtmlTable to PdfPTable.

    thank you,

    Tuesday, March 3, 2015 2:32 AM


All replies

  • User-821857111 posted

    Here's an article that shows how to export a GridView to PDF using iTextSharp: http://highoncoding.com/Articles/483_Exporting_GridView_to_PDF_Document.aspx

    You just need to replace the GridView with your HtmlTable control. However, as the article says, you don't have much control over the formatting. My advice is to create your table in iTextSharp directly and write the rows of data to it. I have an example in one of my iTextsharp articles here: http://www.mikesdotnetting.com/article/86/itextsharp-introducing-tables

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 3, 2015 2:40 AM
  • User1472402676 posted

    thank you 


    Tuesday, March 3, 2015 3:59 AM
  • User1472402676 posted

    Mikesdotnett... i have a another question.

    It's possible to create nested tables in pdfptable

    Tuesday, March 3, 2015 4:06 AM
  • User-821857111 posted

    Yes - my article covers that.

    Tuesday, March 3, 2015 4:12 AM
  • User1472402676 posted

    Sorry i can't find it. can you give me that code

    Tuesday, March 3, 2015 4:26 AM
  • User-760709272 posted


    Sorry i can't find it.

    Ctrl+F then search for "nested"

    We have seen on a number of occasions how a cell can stretch horizontally through the use of the Colspan property. But what about vertically? In HTML you would use the Rowspan property, but there is no equivalent in iTextSharp. So the answer is nested tables.

    Tuesday, March 3, 2015 4:36 AM
  • User1472402676 posted

    Thank you  

    Tuesday, March 3, 2015 5:09 AM