Not sure which PDF library you're using here but one that always works well for me is iTextSharp PDF:
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
public void generatePDF(string[] htmlPages, FileInfo Output, string password)
{
Document document = new Document(PageSize.A4);
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(Output.FullName, FileMode.Create));
writer.SetEncryption(PdfWriter.STRENGTH128BITS, password, "MasterPassword", PdfWriter.ALLOW_PRINTING);
document.Open();
for (int iteratePages = 0; iteratePages < htmlPages.Length; iteratePages++)
{
ArrayList lt = iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new StringReader(htmlPages[iteratePages]), null);
ColumnText ct = new ColumnText(writer.DirectContent);
ct.SetSimpleColumn(20, 20, PageSize.A4.Width - 20, PageSize.A4.Height - 20);
for (int k = 0; k < lt.Count; ++k)
{
ct.AddElement((IElement)lt[k]);
}
document.NewPage();
ct.Go();
}
document.AddAuthor("Your Name");
document.AddCreator("Your Company");
document.AddSubject("Doc Subject");
document.AddTitle("Hello PDF");
document.Close();
}
The above function takes an array of HTML strings as the pages of the document so within that HTML you can specify the font size.
You need to reference itextsharp.dll which is avaiable to download here[^]