I am very unfamiliar with generating PDF from multiple forms. In fact, I've never generated a PDF using any kind of programming language. Now I have been trying 2 different methods for what I want to do. Unfortunately after a few days I still haven't found out how to do this.
I have multiple forms with data pre-filled in those using 3 different lists, now I want to generate a PDF of this form and I have been using Rotativa for this. Unfortunately, once I call the method to generate the PDF, it generates a PDF of the view, but the data is missing. With iTextSharp I could have the data of 1 single list, not all of them, also I dont know if it is possible to save this PDF on the server using iTextSharp.
Q1: What method should I use? What do you suggest? using Rotativa or iTextSharp?
Q2: Is this doable for someone without much experience in programming or should I try to find another way? I
Q3: Am I still missing a way to do this? I would prefer a method without using 3rd party software.
public byte[] GetPDF(string pHTML) { byte[] bPDF = null;
}
Use ITextSharp its a .NET PDF library which allows you to generate PDF (Portable Document Format).
So first of all need to add reference of iTextSharp in your project.
You can get iTextSharp reference using package manager, you just need to execute following command to download and add reference.
PM> Install-Package iTextSharp
Now you need to create a method which will give you byte array of PDF content, so our code will be