Guide
How to use standard PDF fonts in C#
Register a standard font once with RegisterStandardFontAsync(...), then reuse the returned
PdfFont when you add text to pages.
This is a good fit for built-in faces like Helvetica, Times, and Courier when you want a simple text path without shipping a separate font file.
Register the font, then write text with it
Standard fonts are registered at the document level and then passed into the text-writing overload.
using ZingPDF;
using ZingPDF.Fonts;
using ZingPDF.Graphics;
using ZingPDF.Syntax.CommonDataStructures;
using var pdf = Pdf.Create();
var page = await pdf.GetPageAsync(1);
var font = await pdf.RegisterStandardFontAsync(StandardPdfFonts.HelveticaBold);
await page.AddTextAsync(
"Quarterly report",
Rectangle.FromDimensions(240, 80),
font,
18,
RGBColour.Black);
await pdf.SaveAsync(File.Create("standard-font.pdf"));
Use the built-in font name helpers
ZingPDF exposes the standard font names through StandardPdfFonts, so you can choose from the
common Helvetica, Times, and Courier variants without hard-coding the strings yourself.
That keeps the write path readable and makes it obvious which face the page content is using.
Use standard fonts when built-in PDF faces are enough
Standard fonts work well for labels, headers, simple reports, and generated output where Helvetica, Times, or Courier are acceptable.
If you need a specific corporate font or a font file you control, switch to embedded TrueType registration instead.
Need to embed your own font file?
If the output has to use a specific typeface, the next step is registering a TrueType font.