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

Squared or missing characters in a wkhtmltopdf PDF usually mean the conversion process cannot use a font containing those characters—not that the PDF needs another UTF-8 setting. Check the exact affected script, confirm the input is decoded correctly, then verify font coverage and font availability inside the same host or container that runs wkhtmltopdf. Installing an appropriate font there and refreshing the font cache may resolve the problem, but the result must be tested with the actual PDF renderer.

What squares in a PDF usually mean

A square, blank space, or empty-looking field can appear when the font selected for a character has no glyph for it, or when wkhtmltopdf cannot access the intended font. This often affects only a particular language, script, or symbol while other text renders normally. Reports describe failures involving Chinese, Greek or Georgian characters, and Thaana; those are examples of environment-specific problems, not evidence that every instance has the same cause.

Think of text rendering as two separate jobs: the input must be decoded into the intended characters, and the renderer must find a usable font with glyphs for those characters. Correct UTF-8 handling solves the first job; it does not install fonts or supply missing glyphs.

Diagnose the failure in the order that matters

1. Identify exactly which characters fail

Copy a short sample of the affected text and note its script. If nearly all text is garbled, investigate how the input bytes are decoded. If Latin text works but one script or a few symbols become squares, prioritize font coverage, fallback, and the renderer’s runtime environment.

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

2. Verify the input encoding, but do not stop there

Check that the source file or HTTP response is actually encoded as intended and that the HTML declares the matching charset. For a UTF-8 document, a typical declaration is <meta charset="utf-8">. The wkhtmltopdf option --encoding utf-8 may be relevant when its input encoding needs to be specified. Neither declaration installs a font. Reports of square output despite UTF-8 settings illustrate why encoding alone may not fix a glyph-coverage problem.

3. Check fonts where conversion runs

Inspect the VM, host, or container that executes wkhtmltopdf—not just your workstation or a separate browser container. A font visible on a developer machine is not necessarily installed in production. On Linux, fontconfig tools such as fc-list can help inspect available fonts; language-specific queries can narrow the check, for example fc-list :lang=dv for Thaana coverage.

A listed family is a useful clue, not proof that the PDF renderer can use the needed glyph. A reported Thaana case still produced squares even though fc-list :lang=dv listed Noto Sans Thaana. Check the actual font file, its script coverage, and the PDF result.

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⁴

4. Install a suitable font and refresh the cache

If no installed font covers the target characters, install an appropriate language font package in the same runtime environment as wkhtmltopdf. Package names and installation steps differ by Linux distribution and image. After installing fonts, refreshing fontconfig’s cache may be necessary; fc-cache -v is a reported CentOS troubleshooting step, not a universal fix or distribution-independent installation recipe. Rerun the conversion after the cache refresh.

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

5. Verify CSS font selection and fallback

Inspect the styles actually applied to the affected text. Confirm the computed font-family, the order of fallback families, and whether the font file referenced by @font-face is reachable by the conversion process. A browser preview may use a locally installed font that the wkhtmltopdf process cannot access. Custom fonts can also lack the needed code points or weight even when the CSS declaration appears valid.

For diagnosis, compare the output using a known installed font with coverage for the affected script. If the font is delivered by a URL, verify access from the conversion environment; if it is local, verify the path and permissions there. Do not assume that declaring a family guarantees that it loaded.

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.

6. Record the exact renderer and platform

Capture the wkhtmltopdf version, package source, operating system and version, CPU architecture, container base, and relevant font packages. Runtime libraries and packaging can change behavior. The wkhtmltopdf project’s downloads guidance says rendering depends on the runtime configuration of installed fonts, including fontconfig and freetype2, and cautions that generic binaries do not work equally across distributions. It specifically flags Alpine/musl compatibility concerns, so avoid applying a recipe for another distribution without verifying the package and runtime combination.

7. Make a minimal reproduction in production

Create a short HTML file containing only the exact affected characters, a charset declaration, the relevant language metadata if applicable, and one candidate font. Convert it using the same wkhtmltopdf binary, command options, user account, and production image as the failing job. Compare the resulting PDF with the HTML preview. This isolates font and runtime problems from unrelated page CSS; a browser rendering correctly is not proof that PDF conversion uses the same font environment.

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

Common misdiagnoses and what to do instead

Assumption Why it can fail Better check
“UTF-8 is enabled, so every character must render.” Encoding determines character decoding; it does not provide glyphs. Check font coverage and availability in the conversion environment.
“The font is installed on my computer.” The production host or container may have a different font set. Inspect fontconfig and test conversion where wkhtmltopdf actually runs.
“fc-list shows the font, so it must work.” A listed family does not prove the renderer can use the needed glyph or font file. Use a minimal PDF test and verify script coverage and font loading.
“Refreshing the cache will fix it.” Cache refresh can help after installation but cannot add missing coverage or resolve every script-specific issue. Confirm the correct font is installed first, refresh the cache, and retest.
“Any wkhtmltopdf binary will behave the same on Linux.” Builds depend on runtime libraries and platform details; Alpine/musl can differ from other environments. Verify the exact binary, operating system, architecture, and runtime dependencies.

Troubleshooting by symptom

All text is garbled, not just one script

  • Check the source bytes and declared charset for a mismatch.
  • Confirm the encoding option and input source are consistent.
  • Use a minimal document to distinguish decoding trouble from the page’s CSS and fonts.

Only Chinese, Thaana, or another script is squared

  • Check whether a font with coverage for those characters is installed in the runtime that performs conversion.
  • Verify font selection and fallback in the generated PDF, not solely in a browser preview.
  • If fontconfig lists a candidate but output still fails, verify the actual font file and run the minimal reproduction.

It works locally but fails in a container or server

  • Compare font packages and fontconfig/freetype2 availability between environments.
  • Check whether the production image uses a different base distribution, architecture, or wkhtmltopdf build.
  • Install fonts and refresh the cache in the image or host that runs the conversion, then rerun the same test.

A custom @font-face font appears to load but glyphs remain missing

  • Verify the font URL or local path is reachable by the renderer process.
  • Confirm the font file includes the code points and weight used by the affected text.
  • Compare against a known installed font with relevant script coverage to isolate custom-font loading from glyph coverage.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to keep wkhtmltopdf and when to reconsider it

Keeping the existing renderer makes sense when you can install and maintain the right fonts and runtime dependencies in the production environment, and your required HTML/CSS layout continues to render acceptably. Reconsider the setup if the necessary font stack cannot be supported on the target OS or container, or if maintaining that environment is more costly than moving to another rendering approach. The available project guidance establishes runtime dependencies as a concern; it does not establish that a particular replacement service will preserve your layout or solve every script issue. Validate any alternative with the same representative text and documents before migrating.

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

Or skip the browser setup

For a website image or PDF capture workflow, ScreenshotNeo is a separate hosted API option; it does not install fonts into your wkhtmltopdf runtime or repair an existing PDF. Its one-request screenshot endpoint is:

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

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie/consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step 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. An MCP server provides screenshot and PDF-capture tools for AI agents. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo, or sign up free for 1,000 screenshots a month with no card.

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.

Frequently Asked Questions

Can a PDF viewer cause characters to look like squares?

It is possible for display software to affect how a PDF appears, but the troubleshooting evidence here concerns glyphs missing in wkhtmltopdf output. Compare the PDF in another viewer before changing the source document.

Does this establish a universal font package or command for every Linux distribution?

No. The correct font package and runtime setup depend on the distribution and environment running wkhtmltopdf.

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.