Generate PDF Easily based of ITextSharp
4 min readMay 29, 2024
This is the first of three articles about creating PDF documents using iTextSharp. The Namespace is really big, so I will focus on the parts you’ll probably use when you need to create PDFs on a daily basis. There are tons of articles out there but they often just show a specific task, so I thought I might do one simple step by step, starting off with the basics.
You can Use my github sample and use my function that I Wrote in the top link.
PdfGenerator function Parameters
public class PdfGenerationModel
{
/// <summary>
/// set pdf file name
/// </summary>
public string? Filename { get; set; } = Guid.NewGuid().ToString();
/// <summary>
/// alocate a image address for show in header of pdf
/// </summary>
public string ImagePath { get; set; }
/// <summary>
/// if you want to change font from B-Nazanin
/// </summary>
public string FontDirection { get; set; }
/// <summary>
/// Header image location in the page
/// </summary>
public HeaderImageLocation HeaderImageLocation { get; set…