October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Font Awesome

How to Print Font Awesome Icons in PDFs with wkhtmltopdf

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

Use Font Awesome’s Web Fonts and CSS together, and make sure wkhtmltopdf can read both. Copy the matching css and webfonts directories into assets available to the HTML, load fontawesome.css plus the style sheet that defines your icons (for example, solid.css or brands.css), then verify every CSS-relative font URL before converting. Missing font files, an incorrect icon prefix, a mismatched Font Awesome version, or blocked local-file access produces empty squares or blank space.

What must be present for an icon to print

A Font Awesome icon is not an image embedded by the <i> element. The element’s classes select a glyph, while the Font Awesome CSS maps that glyph to a Unicode value and an @font-face rule supplies the font file. Those pieces are coupled dependencies:

  • The HTML must load the base Font Awesome CSS.
  • It must also load the style sheet containing the icon, such as solid.css or brands.css.
  • The CSS-relative URLs must resolve to the corresponding files in webfonts.
  • The class prefix, icon name and installed Font Awesome version must agree.

Copying only CSS, or only the font files, cannot restore the intended glyph. Start by opening the exact HTML in a normal browser. If the icon is missing there, wkhtmltopdf is not the first problem to solve.

Prepare a self-hosted Font Awesome asset tree

Keep the CSS-to-font relationship intact

A simple layout is:

project/
  page.html
  assets/
    fontawesome/
      css/
        fontawesome.css
        solid.css
        brands.css
      webfonts/
        fa-solid-900.woff2
        fa-solid-900.woff
        fa-brands-400.woff2
        fa-brands-400.woff

The exact filenames depend on the Font Awesome package you installed. Preserve the supplied directory relationship, or edit each @font-face URL so it points to the new location. Relative URLs are resolved from the CSS file, not from the HTML file.

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

Load the base sheet and the styles you use

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>wkhtmltopdf icon test</title>
  <link rel="stylesheet" href="/assets/fontawesome/css/fontawesome.css">
  <link rel="stylesheet" href="/assets/fontawesome/css/solid.css">
  <link rel="stylesheet" href="/assets/fontawesome/css/brands.css">
</head>
<body>
  <h1><i class="fa-solid fa-file-pdf" aria-hidden="true"></i> PDF export</h1>
  <p><i class="fa-brands fa-github" aria-hidden="true"></i> Project source</p>
</body>
</html>

Only include the style sheets you need, but do not omit the base sheet required by the package. The prefix and icon name above are examples; use the names documented for the version actually installed in your project.

Make wkhtmltopdf reach the assets

Prefer a reachable HTTP(S) origin

Run a small local web server or use the same origin that serves your application, then give wkhtmltopdf an HTTP(S) URL:

wkhtmltopdf http://127.0.0.1:8000/page.html icons.pdf

This avoids many file:// path and permission surprises. Confirm that the conversion process can reach the host from the machine or container where wkhtmltopdf runs; a browser on your laptop being able to open the page does not prove that a remote build worker can.

Use local files only when local-file access is allowed

For a file-based job, keep page.html, css and webfonts in a readable location and preserve their relative paths:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --enable-local-file-access /absolute/path/project/page.html icons.pdf

Local-file behavior is controlled by the renderer’s documented load policy. Some packaged builds disable local-file access by default or expose a differently named setting. Check the options reported by your installed binary (for example, wkhtmltopdf --extended-help) and configure its local-file policy accordingly. If policy changes are undesirable, serve the assets over HTTP(S) instead.

Use absolute or correctly rooted URLs outside the normal document root

When a PDF worker runs outside your web server’s document root, a URL such as /assets/fontawesome/css/solid.css may point to the wrong filesystem or host. Either provide a fully qualified URL, set the document’s base URL to a reachable origin, or use a file layout whose relative paths are valid from the HTML being converted.

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⁴

A deterministic conversion workflow

  1. Choose one Font Awesome installation. Remove accidental copies injected by a theme, component library or older template.
  2. Check the browser render. Open the exact URL or file used by the PDF job and confirm at least one solid and one brand icon.
  3. Inspect the loaded CSS. Verify that the browser receives the intended base and style sheets, and inspect every @font-face URL.
  4. Check font responses. A missing, forbidden or incorrectly typed font response means the CSS mapping has no usable glyph source.
  5. Run a one-icon fixture. Convert a minimal page containing one known icon before adding your complete document.
  6. Convert the full document. Keep the same origin, asset paths and renderer flags used by the successful fixture.
  7. Archive the inputs for debugging. Record the HTML, CSS and webfont files used for a failed build so a later package update cannot silently change the result.

HTTP assets versus local assets

Choice Advantages Risks and controls
HTTP(S), same reachable origin Normal browser URL resolution; easier to test with developer tools; avoids most local-file permission issues. The conversion host must have network access and the URL must be available to that host. Protect private pages with the required headers or cookies.
file:// or local paths Works without a web server and can be fully self-contained. The renderer may block local-file access. Keep CSS and webfonts together and enable the documented local-file policy only as needed.

Match version, prefix and style exactly

Font Awesome’s common failure causes include using an icon that is not present in the loaded version, using a wrong style prefix, pointing at missing hosted files, and loading conflicting Font Awesome versions. Treat the following as a single compatibility check:

Check What to verify Typical symptom when wrong
Version The HTML classes and CSS/webfont package come from the same installed version. An empty square or no visible glyph for only some icons.
Prefix The class prefix matches the style, such as fa-solid for a solid icon or fa-brands for a brand icon. The element occupies space but displays no intended symbol.
Name The icon name exists in that version and style. One icon fails while neighboring icons work.
Duplicate copies Only the intended Font Awesome CSS and webfonts are loaded. Results change between browser and PDF or after stylesheet order changes.

Why empty squares appear and how to fix them

The icon is absent in the browser

Check the class spelling, style prefix and icon availability in the installed version. Replace the failing element with a known icon from the same style. Do not debug wkhtmltopdf until this browser fixture works.

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

The browser works, but the PDF shows a square

Inspect the PDF job’s URL, not a different development page. Look at the CSS response and each @font-face URL from the conversion host. If those requests fail, fix the origin, path, permissions or local-file policy. A browser cache can hide a broken relative path that a clean PDF process exposes.

Only brand icons fail

Load the style sheet that defines brand icons and verify that its matching brand webfont files are present. Loading solid.css alone does not provide brand glyphs.

Only some icons fail after an upgrade

Compare the icon names and prefixes with the newly installed version. A stylesheet from one package combined with webfonts from another can leave valid-looking classes without the expected Unicode mapping.

Local files are blocked

Use an HTTP(S) origin, or enable the renderer’s documented local-file access setting for the conversion. Confirm the setting on the actual binary used in production; wrapper libraries and container images may pass different defaults.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

The engine rejects part of the font CSS

Some PDF engines handle only particular webfont formats. A related PDF-engine guide notes that symbol fonts such as Font Awesome may require removing non-TrueType @font-face sources from the associated CSS. If your wkhtmltopdf build cannot consume the supplied format, test a compatible TrueType asset and remove unsupported sources while retaining the correct Unicode mappings.

The page is blank or times out

Separate page loading from icon loading. First convert a plain page with no external assets. Then add the CSS, then one font, then the icon. This isolates a network, authentication or timeout failure from a font-format problem.

Make the build reliable in CI

  • Pin the asset package. Keep the CSS and webfonts from one known Font Awesome version in the same deployable artifact.
  • Use a fixture test. A tiny page with one solid and one brand icon catches missing files, wrong prefixes and blocked local access before a large report is generated.
  • Test from the conversion host. Run the same URL or file path under the same user, container and network policy as production.
  • Minimize moving parts. Self-hosting avoids an external kit request; a hosted kit can reduce path maintenance but adds a dependency on kit delivery and availability.
  • Inspect failures separately. A missing font response, a blocked file, an unsupported format and an unknown icon name require different fixes.

Self-hosted files or a hosted Font Awesome kit?

A hosted Font Awesome Kit can reduce asset-path maintenance because the provider packages and serves the CSS and fonts. Self-hosting gives tighter control over exactly which files and versions enter a PDF build and can simplify offline or restricted environments. Whichever route you choose, wkhtmltopdf still needs a reachable stylesheet and the corresponding font files, and only one intended Font Awesome version should be active.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your page is already publicly reachable and you want a rendered PDF without maintaining a wkhtmltopdf process, ScreenshotNeo provides a website screenshot API and MCP server. It can capture a page as a PDF, while also accepting the page’s cookie or consent banner and removing more than 60 known consent platforms, newsletter popups and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Use the API endpoint shown in the ScreenshotNeo documentation:

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

For a PDF target, request PDF output using the documented format and PDF options for your endpoint; the same service supports paper size, margins, landscape mode and page ranges. A direct URL capture does not repair a page whose Font Awesome assets are inaccessible: make sure the target page itself renders the icons before submitting it.

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. Every feature is available on every plan: 1,000 screenshots per month are free with no card, and paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

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

FAQ

Can CSS pseudo-elements use Font Awesome in the PDF?

Yes, provided the same stylesheet containing the pseudo-element’s content rule and the matching webfont is reachable during conversion. Test the pseudo-element in the exact PDF URL rather than assuming a browser-only stylesheet is loaded.

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

Why does text extraction show a strange character for an icon?

Font Awesome maps each icon to a private Unicode value. PDF text extraction may therefore expose that underlying value instead of a human-readable label. Keep a visible text label or accessible alternative when the symbol conveys information.

Should I copy every Font Awesome webfont?

No. Copy the files referenced by the styles you load, plus any required base assets, and keep their CSS-relative paths valid. Copying unrelated files does not fix a broken URL or a mismatched style.

Frequently Asked Questions

Can CSS pseudo-elements use Font Awesome in the PDF?

Yes, provided the stylesheet containing the pseudo-element’s content rule and the matching webfont is reachable during conversion. Test the exact PDF URL.

Why does PDF text extraction show a strange character for an icon?

Font Awesome maps icons to private Unicode values, so extraction may expose that value instead of a readable label. Include a text label or accessible alternative when the symbol carries meaning.

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

Should I copy every Font Awesome webfont?

No. Copy the files referenced by the styles you load and preserve their CSS-relative paths.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.