IRONSOFTWAREHOME
Custom Fonts in HTML to PDF
using IronPdf;

var htmlWithFont =
    @"<link href=""https://fonts.googleapis.com/css?family=Lobster""rel=""stylesheet""><p style=""font-family: 'Lobster', serif; font-size:30px;"" > Hello Google Fonts</p>";

// Instantiate Renderer
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.WaitFor.AllFontsLoaded();

var doc = renderer.RenderHtmlAsPdf(htmlWithFont);

// Export to a file or Stream
doc.SaveAs("font.pdf");
Imports IronPdf

Dim htmlWithFont = "<link href=""https://fonts.googleapis.com/css?family=Lobster""rel=""stylesheet""><p style=""font-family: 'Lobster', serif; font-size:30px;""> Hello Google Fonts</p>"

' Instantiate Renderer
Dim renderer = New ChromePdfRenderer()
renderer.RenderingOptions.WaitFor.AllFontsLoaded()

Dim doc = renderer.RenderHtmlAsPdf(htmlWithFont)

' Export to a file or Stream
doc.SaveAs("font.pdf")
NuGet Download
PM > Install-Package IronPdf
Custom Fonts in HTML to PDF

Custom Fonts in HTML to PDF

Custom fonts can be vital in developing PDFs with a particular style. Companies and organizations may want custom fonts in addition to company-specific icons or graphics to showcase their brand. IronPDF supports web fonts, including the incredible Google Fonts library.

This example shows you how to include your own custom fonts in PDFs using the IronPdf custom fonts support feature. It gives the developer full font control without needing to depend only on System typefaces.

However, implementing custom fonts in your PDF has a small caveat. There will be the need for a RenderDelay. Also, web fonts do not work on Azure shared Windows Web App hosting for Microsoft's own security reasons.

Web Fonts Supported Include:

Make sure you have the IronPDF library installed in your project to use its features effectively. This guideline helps in customizing fonts to align with branding or stylistic needs.

Learn More About Web Fonts and Icons with IronPDF
View on GitHub

Ready to Get Started?

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

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