How to generate PDF in ASP net using iTextSharp?

iTextSharp

  1. Open VisualStudio and then create a new ASP.NET web application.
  2. Add a reference to the iTextSharp.
  3. Add the following namespaces before proceeding:
  4. In the designer, drag and drop two buttons as follows,
  5. For the Generate PDF File button, write the following code to generate the PDF file:

How to generate PDF using iTextSharp in MVC?

Generate PDF Using iTextSharp In ASP.NET MVC

  1. using iTextSharp.text;
  2. using iTextSharp.text.html.simpleparser;
  3. using iTextSharp.text.pdf;
  4. public class PdfController : Controller.
  5. {
  6. public void DownloadPDF()
  7. {
  8. string HTMLContent = “Hello World”;

How to generate PDF in ASP net MVC?

Steps to create PDF document in ASP.NET MVC

  1. Create a new ASP.NET MVC application project.
  2. Install the Syncfusion. Pdf. AspNet. Mvc NuGet package as a reference to your . NET Framework applications from NuGet.org.
  3. By executing the program, you will get the PDF file as follows.

What is iTextSharp in asp net?

What is ITextSharp? iTextSharp is a free and open source assembly that helps to convert page output or HTML content in a PDF file. You can download it from here: http://sourceforge.net/projects/itextsharp/ Now add that DLL in the application.

What is iTextSharp text PDF?

Itextsharp is an advanced tool library which is used for creating complex pdf repors. itext is used by different techonologies — Android , . NET, Java and GAE developer use it to enhance their applications with PDF functionality.

How can I create and download PDF file in C#?

How to Create PDF file in C# . NET – 5 Easy Steps

  1. Create PDF File in C# .NET. Step 1 – Create a Project of the type Windows Forms App C# .NET. Step 2 – Add Reference to PDF Sharp Library. Step 3 – Add Code to Generate PDF using PDF Sharp. Step 4 – Run and Test the Code.
  2. Summary.
  3. Download Source Code.

Is iTextSharp deprecated?

PLEASE NOTE: iTextSharp is EOL, and has been replaced by iText 7. Only security fixes will be added. We HIGHLY recommend customers use iText 7 for new projects, and to consider moving existing projects from iTextSharp to iText 7 to benefit from the many improvements such as: HTML to PDF (PDF/UA) conversion.