IRONSOFTWAREHOME

Form Field Font Fallback Control

Curtis Chau
Curtis Chau
Updated: August 21, 2026

IronPDF auto-embeds a Tahoma/Arial fallback font whenever a form field's Value is set to a non-ASCII string, which can override the font a template actually needs. As of IronPDF 2026.6.1, three new methods give you direct control over that behavior.

To embed a specific font, have a TrueType/OpenType (.ttf/.otf) file ready. To only suppress the fallback, no font file is needed.

Solution

Set the font at the document level before filling any field that needs it. Three methods on PdfDocument replace the old manual workaround.

Option A: Embed a Font from Bytes

Pass a font name and the raw font bytes to SetFormFont:

var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFont("Poppins-Regular", File.ReadAllBytes("Poppins-Regular.ttf"));
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş ğ";
pdf.SaveAs("filled.pdf");
C#

SetFormFont writes into the AcroForm /DR /Font dictionary under the given fontName. If the template already used that exact name for a different font, it gets replaced, so pick a non-colliding name when you need to preserve the original mapping.

Option B: Embed a Font from a File Path

When you have a path rather than bytes, use SetFormFontFromFile:

var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFontFromFile("Poppins-Regular.ttf");
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş";
pdf.SaveAs("filled.pdf");
C#

Option C: Suppress the Fallback

DisableFormFontFallback stops the Tahoma/Arial auto-embed without adding anything to the file:

var pdf = PdfDocument.FromFile("template.pdf");
pdf.DisableFormFontFallback();
// do not auto-embed Tahoma/Arial
pdf.Form.FindFormField("bookingNumber").Value = "AS2323445";
pdf.SaveAs("filled.pdf");
C#

Recommended when: the template's existing font references, plus the PDF viewer's own font substitution, already render the values correctly. This option costs zero file size.

All three examples assume a field named "bookingNumber" exists in template.pdf. FindFormField returns null when the name matches no field, so check for null before setting .Value or you'll hit a NullReferenceException rather than a font problem.

The Pre-2026.6.1 Workaround

Before these methods existed, SetDefaultFont() on a form field did not control the Tahoma/Arial auto-fallback for non-ASCII text. The only override was to construct the field's DefaultAppearance string by hand:

field.DefaultAppearance = "/Helvetica-Bold 12 Tf 0 0 0 rg";
C#

The format is /{FontName}-{Weight} {FontSize} Tf {R} {G} {B} rg. The named font must already be registered in the document's AcroForm resource dictionary, and the values are raw PDF text operators with no validation.

Notes and Limitations

  • Document-wide, not per field: all three methods apply across the document. When different fields need different fonts, call SetFormFont once per font variant.
  • Trigger condition: the auto-fallback only fires when a field's Value is set to a non-ASCII string. Other field updates (renaming, ReadOnly) are unaffected regardless of which option you use.
  • Font name characters: fontName allows letters, digits, -, _, ., +. A 6-letter PDF subset prefix (e.g. AAAAAA+Poppins-Regular) is accepted and stripped automatically to the canonical name.
  • Force embed: forceEmbed: true adds a fresh font copy on every call, growing the file each time. Leave it false unless you know the existing embed is stale.
  • Exceptions: SetFormFont throws ArgumentException for an invalid fontName or fontData. SetFormFontFromFile also throws FileNotFoundException when the path doesn't exist.
Please note: The pre-existing per-field method IFormField.SetDefaultFont(fontName, fontSize, fontColor) is unrelated and unchanged. It sets a field's appearance using a font that must already be installed on the rendering machine, and does not affect the non-ASCII auto-fallback described here.

Equivalent functionality ships in IronPDF Python 2026.6.0.1+ and IronPDF Java 2026.6.1+ under each language's own naming convention (for example Java's FormManager.setFormFont/setFormFontFromFile/disableFormFontFallback, camelCase), which is not verified here to the same standard as the C# signatures above.

For more on fonts, see Manage PDF Fonts in C#.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 21,105,021Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999