DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
custom fonts

How to Fix Custom Fonts Not Appearing in wkhtmltopdf PDFs

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a custom font is missing from a wkhtmltopdf PDF, first prove that the exact wkhtmltopdf process can read the font file. Then check local-file access, Linux font installation and fontconfig caches, runtime permissions and font-face metadata—before changing page layout. A font that works in Chrome may still be unreachable or unsupported in the renderer’s own runtime.

Why a custom font disappears in a wkhtmltopdf PDF

wkhtmltopdf renders HTML through its own runtime; it does not simply reuse the browser session where you previewed the page. Chrome being able to load a stylesheet or font does not prove that wkhtmltopdf can reach the same URL, read the same local path, or find the same installed font. The project also notes that rendering depends on the fonts, fontconfig and FreeType available in the runtime, and that results can differ across platforms.

That makes this a useful separation to keep in mind: there is a font-loading problem if the renderer cannot obtain or recognize the face, and a layout problem if it obtains the face but the PDF still looks wrong. Test font loading independently before adjusting margins, widths or other CSS.

Start with a controlled reproduction

Before changing packages or CSS, record the environment that actually produces the PDF. If your laptop and production container use different binaries or operating systems, their results are not a controlled comparison.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
  • Record the output of wkhtmltopdf --version, the operating-system or container image, the user running the command and all command-line flags.
  • Write down the HTML entry-point URL, stylesheet URL and font file names. Note whether each is remote, relative or local.
  • Make a minimal HTML page containing one distinctive sentence and one @font-face declaration. Remove unrelated layout rules and other font faces.
  • Run the minimal page with the exact binary, user and runtime image used in production. Change one font source or setting at a time.

This limits the variables. If the small page fails under the production binary too, the issue is less likely to be a page-layout interaction. If it works, reintroduce the original stylesheet and layout in stages.

Check that the renderer can reach the font

Use an explicit, fully resolved font URL or an absolute file:/// path that the wkhtmltopdf process is allowed to read. A relative URL may resolve differently depending on whether the input HTML came from a file or a web address. Test the stylesheet and font separately rather than assuming that loading one proves the other is available.

  • Check whether the stylesheet and font requests return an error such as 404 or 403, redirect unexpectedly, or fail during transfer.
  • On Linux, check filename capitalization: paths are case-sensitive.
  • Confirm that the CSS font-family name used by the test element matches the family declared in @font-face.
  • Use one source at a time—remote URL, relative path, absolute path or local file—to isolate which access route fails.

A page that loads in a browser is not proof that wkhtmltopdf can access its resources. The rendering process may run in a container, under a different user, or with different network and filesystem permissions.

Set local-file access deliberately

wkhtmltopdf’s local-file policy can prevent a local HTML file from reading other local files. The command-line options distinguish between allowing local reads and restricting them to explicitly permitted paths. Use the narrowest setting that fits the input you trust; broadly allowing filesystem access for untrusted HTML can expose files the document should not be able to read.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --enable-local-file-access input.html output.pdf
# Or keep access restricted and allow only the assets directory:
wkhtmltopdf --disable-local-file-access --allow /srv/app/assets input.html output.pdf

Adapt paths to your deployment. If your HTML and font are in different directories, ensure the permitted path covers the actual font location. A successful command does not prove every resource loaded, so verify the resulting PDF and continue checking runtime visibility if the font is still absent.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

Local-file flags are not the only possible boundary. AppArmor or another sandbox policy can restrict access to font files or fontconfig cache paths even when the command-line policy appears correct. Check the policy and logs for the execution environment when paths and flags seem right.

Install and index fonts in Linux or Docker

On Linux, copy the font into a directory fontconfig scans. Common locations include /usr/local/share/fonts or an application directory explicitly included in fontconfig’s configuration. Installing a file is not always enough: fontconfig needs to index it, and its cache should be refreshed after installation.

  1. Copy the font files into the selected directory in the same image or runtime environment that launches wkhtmltopdf.
  2. Rebuild the fontconfig cache, for example with fc-cache -f -v /path/to/fonts.
  3. As the same execution user that runs wkhtmltopdf, inspect available faces with fc-list and check the requested family with fc-match.
  4. Generate the PDF again using the production binary and user, then verify that the expected face appears.

For a system-wide installation, /usr/local/share/fonts is a common location; the relevant requirement is that the directory is configured for fontconfig and readable in the runtime. In a container, make sure installation and cache generation happen in the image or startup path that is actually deployed. A font added only to a developer workstation will not be available inside a separate production image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check fontconfig environment and file permissions

Packaged and serverless deployments may use a fontconfig configuration that differs from a desktop Linux installation. Inspect FONTCONFIG_PATH and FONTCONFIG_FILE in the process environment; either can affect which configuration and directories are used. Then check read permissions on both the font files and cache files for the wkhtmltopdf execution user.

  • Run fc-list and fc-match as the renderer’s user, not only as an administrator.
  • Verify that the environment variables point to configuration files and directories present in the deployed runtime.
  • Confirm that the execution user can read the configured fonts and fontconfig caches.
  • If a sandbox is enabled, allow only the font and cache paths the renderer needs.

If fontconfig can see a face when run as root but not as the application user, investigate permissions and the user’s environment before changing the page’s CSS.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

Validate the font file, family, weight and glyph coverage

A readable file can still fail to provide the face the page requests. Check the font with an appropriate font validator or fontconfig tools. Verify its family name, style, weight and Unicode coverage against the CSS and the characters in the PDF. A page can appear to use a fallback font only for certain characters if the requested face lacks those glyphs.

Begin with a simple, static TTF face and one CSS weight. Once that works, test additional weights or more complex font files separately. Missing glyphs, incorrect weight mappings, corrupted files and unsupported face formats are all plausible causes of an @font-face problem; changing page layout does not correct them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why local and production PDFs can differ

Compare like with like: the wkhtmltopdf version, operating-system image, execution user, command flags, font files and fontconfig environment. Differences in any of these can change font availability or rendering. The project documents runtime dependence on installed fonts, fontconfig and FreeType, as well as cross-platform differences.

The project’s stable release series is 0.12.6, released June 11, 2020. If the font file is valid and readable, fontconfig sees it, permissions and access policy are correct, and the face still fails with the production binary, the older Qt WebKit rendering stack may be the limiting factor. The project repository is archived and read-only, so persistent compatibility issues are a reasonable point to evaluate a maintained HTML-to-PDF engine.

Decision factor Continue with wkhtmltopdf Evaluate a maintained engine
Font formats and CSS Useful if the required face and CSS already render correctly in your exact runtime. Worth testing if a valid, visible font face is still ignored or rendered incorrectly.
Local-file and sandbox controls Keep narrow access rules and verify the renderer can read only the required paths. Compare how the alternative handles local resources and sandboxing before switching.
Reproducibility across operating systems Pin the binary, runtime image, fonts and configuration to reduce environmental differences. Test on every target operating system; do not assume a new engine makes environments identical.
Maintenance and security status The wkhtmltopdf repository is archived and read-only. Confirm the candidate engine is maintained and fits your security requirements.
Deployment size and migration effort Avoid a migration if your pinned runtime meets current needs. Account for deployment changes and revalidate fonts, pagination and layout.

Do not migrate solely because a PDF looks different once. First rule out resource access, font installation, caches, permissions and face mapping. If you do migrate, compare the same representative documents and revalidate layout as well as typography; a new renderer can alter pagination and CSS behavior.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting by symptom

  • The font is missing only in production: compare the deployed binary, image, user, font files and fontconfig environment with the known-good setup. Install and index the font in the production runtime rather than relying on a host installation.
  • The font file exists but fc-match returns a different face: check fontconfig’s configured directories, refresh its cache and confirm the family name and style in the font file.
  • A local font works only when access is broadly enabled: use a narrow --allow path for the required assets, and check whether sandbox policy is also denying access.
  • Only some characters use the custom face: verify that the font includes those glyphs and that the requested face is the one being selected.
  • The family appears but the weight is wrong: check that the requested weight exists and that the CSS face declaration maps to the intended file.
  • Remote fonts fail while local fonts work, or vice versa: isolate each source, check its resolved URL or path, and verify the relevant network or file permissions independently.
  • A valid, visible font still fails in the PDF: repeat with the minimal page and exact production binary. If access, caches, permissions and metadata are confirmed, test a maintained renderer rather than continuing to tune unrelated layout CSS.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not a wkhtmltopdf font debugger or a replacement for PDF generation. For a web-page screenshot, one GET request captures a URL; its capture options include PNG, JPEG or WebP output and PDF. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server gives AI agents tools for screenshots, page information and PDF capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example cURL request for a web-page screenshot (replace the example URL with your target). See the ScreenshotNeo documentation for the API details:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. If you need wkhtmltopdf troubleshooting, use the checks above; if you need a website capture without setting up a browser, see ScreenshotNeo. Sign up for 1,000 free screenshots a month, with no card.

Frequently Asked Questions

How can I tell whether wkhtmltopdf loaded the font or substituted a fallback?

Render a minimal test page that uses only the face in question, then inspect the PDF’s embedded fonts with a PDF font-inspection tool. Compare the reported face with the one declared in your font file.

Does wkhtmltopdf have a command-line option that installs a font?

No. Font installation and fontconfig indexing are runtime or operating-system tasks; the command-line options govern resource access, not font installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is a Chrome preview enough to verify the final PDF?

No. The renderer may run with a different binary, filesystem, network access, fontconfig setup or user permissions than Chrome.

Quick Recap

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.