PDF .NET Library Logo
Home Products Code Library Online Demos Support Forum Buy About Us  
Code Library

How to set the active font in PDF

The following code creates a PDF with sample text using the ARIAL font style.

c# sample:

PDFDocument doc = new PDFDocument("sample.pdf");

doc.CurrentPage.Body.SetActiveFont("Arial", PDFFontStyles.Regular, 12);

doc.CurrentPage.Body.AddText("Sample text.");

doc.Save();

Back to PDF Code Library