Export Entire User Input Form to PDF in C#

Malam Malam 121 Reputation points

I have a form that captures general user information like FirstName, LastName etc.
When user is done entering all information and clicks on the button Button1; I need to export the entire form to PDF.

Is there a way to do it?

First Name: <user Input> City: <user Input>
Last Name: <user Input> State: <user Input>
Address: <user Input> Zip: <user Input>


ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
550 questions
0 comments No comments
{count} votes

Accepted answer
  1. AgaveJoe 22,631 Reputation points

    I do not see iText7.pdfhtml anywhere in your references screenshot.


    As far as I can tell you still have not installed the NuGet package. It's possible that there are build errors which stops the package installation. Usually build errors are very clear. Anyway, fix the build errors first. Once the project builds successfully then install iText7.pdfhtml.

    Pay closer attention to the details.

    0 comments No comments

12 additional answers

Sort by: Most helpful
  1. sreejukg 10,461 Reputation points

    Yes, you can generate PDF from the data you have. iTextsharp is a pdf library that will help you generate pdf document from code. I published an article about generating the pdf from itextsharp, you can read this below.


    hope this helps

    0 comments No comments

  2. Malam Malam 121 Reputation points

    Thanks but this is not what I am looking for; I already know how to export GridView data to PDF.
    My question was "how to export the entire form that include 'captions' and 'user inputs' to PDF"

  3. sreejukg 10,461 Reputation points

    The article was about how to use iTextsharp to generate pdf. it is possible to generate form. Refer the following sample.


    0 comments No comments

  4. Malam Malam 121 Reputation points

    I've looked at that example and still not been able to see how it would convert asp page to pdf.
    Also, I did have all references to iTextSharp but the sample code still generates errors everywhere in the code. For example.
    ConverterProperties properties = new ConverterProperties(); * Error on ConverterProperties
    PdfReader pdfReader = new PdfReader(pdfStream); *
    Error on PdfReader