IronPDF How-Tos Manage Fonts How to Manage Fonts in PDFs Chaknith Bin Updated:July 28, 2025 A font is a set of characters, symbols, and glyphs with a consistent style and design. It represents a specific typeface, size, weight, and style (such as regular, bold, italic, etc.) of text. Fonts are used in typography to display text in a visually appealing and coherent manner. IronPDF provides a convenient way to manage fonts, offering functionalities such as finding fonts, getting fonts, embedding fonts, unembedding fonts, and replacing fonts. How to Manage Fonts in PDFs Download the IronPDF C# Library Utilize the Add method to add a font to the font collection Utilize the Embed method to embed a font to ensure persistent visuals Unembed fonts to reduce size using the Unembed method Easily replace fonts with the Replace method Find and Retrieve Font Retrieve Font Accessing the Fonts property will return the PdfFontCollection object, which contains the list of all the fonts in the document. The Fonts property can be accessed directly by iterating over the PdfFontCollection object. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-retrieve-font.cs using IronPdf; using IronPdf.Fonts; using System.Collections.Generic; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); // Retreive font PdfFontCollection fonts = pdf.Fonts; Imports IronPdf Imports IronPdf.Fonts Imports System.Collections.Generic ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") ' Retreive font Private fonts As PdfFontCollection = pdf.Fonts $vbLabelText $csharpLabel Find Font Finding a specific font is straightforward with IronPDF. Using the PdfFontCollection object, you can specify the font name. This example shows how to access a font object by name and inspect properties. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-find-font.cs using IronPdf; using IronPdf.Fonts; using System.Collections.Generic; using System.Linq; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); // Find font PdfFont font = pdf.Fonts["SpecialFontName"]; Imports IronPdf Imports IronPdf.Fonts Imports System.Collections.Generic Imports System.Linq ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") ' Find font Private font As PdfFont = pdf.Fonts("SpecialFontName") $vbLabelText $csharpLabel Add Font Use the Add method to add both a standard font and a font file as byte data. The method accepting the font name only accepts one of the 14 standard fonts. Adding a standard font does not embed it, as the standard font is already guaranteed to be available on the operating system. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-add-font.cs using IronPdf; using IronPdf.Fonts; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); // Add font pdf.Fonts.Add("Helvetica"); Imports IronPdf Imports IronPdf.Fonts ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") ' Add font pdf.Fonts.Add("Helvetica") $vbLabelText $csharpLabel Embed Font Embedding a font means including a font’s byte stream data in the PDF document itself. This way, it doesn't require the font to be installed on the system to view the PDF document properly. While this generally increases the file size of the PDF document, it's beneficial for visual consistency without the additional requirement of installing the font. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-embed-font.cs using IronPdf; using System.Linq; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); // Add the font byte[] fontData = System.IO.File.ReadAllBytes("dir/to/font.ttf"); // Embed the font pdf.Fonts.Last().Embed(fontData); Imports IronPdf Imports System.Linq ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") ' Add the font Private fontData() As Byte = System.IO.File.ReadAllBytes("dir/to/font.ttf") ' Embed the font pdf.Fonts.Last().Embed(fontData) $vbLabelText $csharpLabel Unembed Font Unembedding a font means removing the embedded byte stream data of the font included in a PDF document. The goal is to reduce the PDF document's file size. Use the Unembed method to achieve this. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-unembed-font.cs using IronPdf; using IronPdf.Fonts; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); // Get fonts PdfFontCollection fonts = pdf.Fonts; // Unembed a font pdf.Fonts[0].Unembed(); Imports IronPdf Imports IronPdf.Fonts ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") ' Get fonts Private fonts As PdfFontCollection = pdf.Fonts ' Unembed a font pdf.Fonts(0).Unembed() $vbLabelText $csharpLabel Replace Font The font replacement operation will preserve the original font data structure, such as styling and character encoding, inside a PDF document but replace it with a newly specified font. Users must ensure that the new font aligns well with the original font. WarningIn some rare cases, the resulting visual may not be a perfect fit. This is a current limitation of the font replacement method. :path=/static-assets/pdf/content-code-examples/how-to/manage-font-replace-font.cs using IronPdf; using IronPdf.Fonts; using System.Linq; // Import PDF PdfDocument pdf = PdfDocument.FromFile("sample.pdf"); byte[] fontData = System.IO.File.ReadAllBytes("dir/to/font.ttf"); // Get and replace Font pdf.Fonts["Courier"].ReplaceWith(fontData); Imports IronPdf Imports IronPdf.Fonts Imports System.Linq ' Import PDF Private pdf As PdfDocument = PdfDocument.FromFile("sample.pdf") Private fontData() As Byte = System.IO.File.ReadAllBytes("dir/to/font.ttf") ' Get and replace Font pdf.Fonts("Courier").ReplaceWith(fontData) $vbLabelText $csharpLabel Standard Fonts The 14 standard fonts in PDF, also known as the 'Base 14 Fonts' or 'Standard Type 1 Fonts,' form a set of fonts that are widely supported in PDF viewers and do not need to be embedded in the document. Standard fonts define 14 fonts that are guaranteed (as per the PDF document standard) to be available when working with a PDF document. Courier Courier-Bold Courier-Oblique Courier-BoldOblique Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique Times-Roman Times-Bold Times-Italic Times-BoldItalic Symbol ZapfDingbats Standard Fonts Mapping For convenience when referring to the standard fonts, multiple string names point to the same font. Map to Courier StandardFont.Courier Courier CourierNew CourierNewPSMT CourierStd Map to Courier-Bold StandardFont.CourierBold Courier,Bold Courier-Bold CourierBold CourierNew,Bold CourierNew-Bold CourierNewBold CourierNewPS-BoldMT CourierStd-Bold Map to Courier-Oblique StandardFont.CourierOblique Courier,Italic Courier-Oblique CourierItalic CourierNew,Italic CourierNew-Italic CourierNewItalic CourierNewPS-ItalicMT CourierStd-Oblique Map to Courier-BoldOblique StandardFont.CourierBoldOblique Courier,BoldItalic Courier-BoldOblique CourierBoldItalic CourierNew,BoldItalic CourierNew-BoldItalic CourierNewBoldItalic CourierNewPS-BoldItalicMT CourierStd-BoldOblique Map to Helvetica StandardFont.Helvetica Arial ArialMT Helvetica Map to Helvetica-Bold StandardFont.HelveticaBold Arial,Bold Arial-Bold Arial-BoldMT ArialBold ArialMT,Bold ArialRoundedMTBold Helvetica,Bold Helvetica-Bold HelveticaBold Map to Helvetica-Oblique StandardFont.HelveticaOblique Arial,Italic Arial-Italic Arial-ItalicMT ArialItalic ArialMT,Italic Helvetica,Italic Helvetica-Italic Helvetica-Oblique HelveticaItalic Map to Helvetica-BoldOblique StandardFont.HelveticaBoldOblique Arial,BoldItalic Arial-BoldItalic Arial-BoldItalicMT ArialBoldItalic ArialMT,BoldItalic Helvetica,BoldItalic Helvetica-BoldItalic Helvetica-BoldOblique HelveticaBoldItalic Map to Times-Roman StandardFont.Times Times-Roman TimesNewRoman TimesNewRomanPS TimesNewRomanPSMT Map to Times-Bold StandardFont.TimesBold Times-Bold TimesBold TimesNewRoman,Bold TimesNewRoman-Bold TimesNewRomanBold TimesNewRomanPS-Bold TimesNewRomanPS-BoldMT TimesNewRomanPSMT,Bold Map to Times-Italic StandardFont.TimesOblique Times-Italic TimesItalic TimesNewRoman,Italic TimesNewRoman-Italic TimesNewRomanItalic TimesNewRomanPS-Italic TimesNewRomanPS-ItalicMT TimesNewRomanPSMT,Italic Map to Times-BoldItalic StandardFont.TimesBoldOblique Times-BoldItalic TimesBoldItalic TimesNewRoman,BoldItalic TimesNewRoman-BoldItalic TimesNewRomanBoldItalic TimesNewRomanPS-BoldItalic TimesNewRomanPS-BoldItalicMT TimesNewRomanPSMT,BoldItalic Map to Symbol StandardFont.Symbol Symbol SymbolMT Map to ZapfDingbats StandardFont.Dingbats ZapfDingbats Frequently Asked Questions How can I find and list fonts used in a PDF document? You can use IronPDF to access the Fonts property of a PdfDocument object, which provides a PdfFontCollection. Iterating over this collection allows you to find and list all fonts used in the document. What methods are available for adding fonts to a PDF? IronPDF allows you to add fonts using the Add method, which can include standard fonts or custom font files as byte data. This method enables you to extend the range of fonts available in your PDF documents. How do you embed fonts in a PDF to ensure visual consistency? To embed fonts using IronPDF, you can retrieve the desired font from the PdfFontCollection and apply the Embed method. This ensures that the font's byte stream data is included in the PDF, maintaining visual consistency across different systems. Why would you unembed a font in a PDF document? Unembedding a font with IronPDF involves removing the embedded byte stream data to reduce the file size. This is useful when file size is a priority and the font is commonly available on most systems. What is the process for replacing a font in a PDF? You can replace a font in a PDF using IronPDF's Replace method within the PdfFontCollection. This allows you to substitute an existing font with another, ensuring it matches the original's style and encoding as closely as possible. Why are the Base 14 Fonts important in PDFs? The Base 14 Fonts, or Standard Type 1 Fonts, such as Courier, Helvetica, and Times-Roman, are crucial because they are universally supported by PDF viewers. They do not need to be embedded, ensuring compatibility and reducing file size. Is it possible to use custom fonts in PDF documents? Yes, IronPDF supports the inclusion of custom fonts. By using the Add method with font file data, you can incorporate any font into your PDF document beyond the standard options. What are the advantages of managing fonts in PDF documents using IronPDF? IronPDF offers robust font management capabilities, allowing you to find, add, embed, unembed, and replace fonts. This flexibility enhances document customization and ensures visual consistency across various platforms. Chaknith Bin Chat with engineering team now Software Engineer Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience. Ready to Get Started? Free NuGet Download Total downloads: 14,968,429 View Licenses