Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →To render accented, Cyrillic, Chinese, emoji, and other non-ASCII characters reliably in a wkhtmltopdf footer, do four things: save the footer file as UTF-8, declare UTF-8 in its HTML, pass --encoding UTF-8 for the input document, and decode URL-substituted values with decodeURIComponent(). Use --footer-html rather than relying on text-only footer options when the footer contains rich or non-ASCII content.
The reliable UTF-8 setup
wkhtmltopdf treats the footer as an HTML resource loaded separately from the main document. Configure both resources explicitly; setting the input encoding alone does not repair a footer that was saved with the wrong bytes, decoded incorrectly, or rendered without a suitable font.
- Save
footer.htmlas UTF-8 without silently converting it to a legacy code page. - Declare the charset in the footer document’s
<head>. - Use
--footer-html footer.htmland keep--encoding UTF-8for the input. - URL-encode values inserted into the footer and decode them once with
decodeURIComponent(). - Make sure the runtime has fonts containing every script you need.
Build a complete UTF-8 footer document
A complete document is more dependable than a fragment. HTML5 syntax is appropriate for current builds; the older HTTP-equiv form is also widely used by wkhtmltopdf integrations.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
body { margin: 0; font: 9pt Arial, sans-serif; color: #333; }
.footer { width: 100%; text-align: center; }
</style>
</head>
<body>
<div class="footer">
<span class="mytitle"></span> · Page <span class="page"></span> of <span class="topage"></span>
</div>
<script>
function subst() {
const params = new URLSearchParams(window.location.search);
document.querySelector('.mytitle').textContent = params.get('mytitle') || '';
document.querySelector('.page').textContent = params.get('page') || '';
document.querySelector('.topage').textContent = params.get('topage') || '';
}
window.onload = subst;
</script>
</body>
</html>
If your integration expects the compatibility declaration, use this instead of (or in addition to) the HTML5 declaration:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitches#1 Best Overall
- 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
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Do not merely change the declaration while leaving the file encoded as Windows-1252, ISO-8859-1, or another encoding. The declaration describes the bytes; it cannot convert them.
Generate the PDF with the correct options
Local footer file
wkhtmltopdf --encoding UTF-8 --footer-html footer.html input.html output.pdf
--encoding UTF-8 is the default text encoding for input. --footer-html tells wkhtmltopdf to load an HTML footer source. The footer can use documented substitution variables such as [page], [topage], [webpage], [section], and [title]; when your script reads values from the footer URL, apply the decoding rule below.
Remote footer URL
You can provide an HTTP(S) footer URL, but the server response must identify a UTF-8-compatible content type. Check the response headers, not only the HTML source:
Content-Type: text/html; charset=utf-8
A remote footer also has to be reachable from the machine and service account running wkhtmltopdf. Authentication, redirects, TLS policy, or network isolation can make a correct footer appear blank.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Fix corrupted substituted values with decodeURIComponent()
A common failure is that literal characters written directly in footer.html render correctly, while a title or other value passed through the footer query string is garbled. The transport is URL-encoded, so decode each value exactly once with decodeURIComponent(). Do not use the deprecated unescape() function.
Rank #2
- 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⁴
function getUtf8Param(name) {
const raw = new URLSearchParams(window.location.search).get(name);
return raw ? decodeURIComponent(raw) : '';
}
window.onload = function () {
document.querySelector('.mytitle').textContent = getUtf8Param('mytitle');
};
URL-encode before constructing the footer URL. In a shell, for example, use a URL-encoding utility rather than concatenating a title containing spaces, ampersands, percent signs, or non-ASCII bytes. Never decode a value twice: a second pass can turn literal percent sequences into errors or different characters.
Why –encoding UTF-8 sometimes appears not to work
The footer is a separate resource
The option establishes a default for input text. It does not override a footer saved with bad bytes or a remote response that declares a conflicting charset.
The URL value was decoded incorrectly
If hard-coded text works but substituted text fails, inspect the query-string code first. Replace unescape() with the one-pass decodeURIComponent() approach and verify the producer URL-encodes the value.
Recommended Free Tools
A glyph is missing
Encoding and font coverage are different problems. A PDF can contain valid UTF-8 while showing empty boxes or dropping Chinese characters because the selected font is absent or lacks those glyphs. Install a font covering the target script and select it explicitly in CSS when necessary.
The build or locale differs
Production may run a different wkhtmltopdf build, operating system, locale, or service account than your workstation. Reproduce with the exact binary and environment before attributing the symptom to charset configuration. Issue reports have documented environment-specific footer behavior, including cases where an explicit charset on footer-html avoided dropped non-ASCII text.
Rank #3
- 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.
footer-html versus footer-text
| Aspect | footer-html | footer-text |
|---|---|---|
| Markup and styling | Supports HTML, CSS, and script-based substitutions. | Text-only path; no rich layout. |
| Non-ASCII reliability | Preferred for rich or non-ASCII content when the document declares UTF-8. | Issue reports describe characters being dropped in some environments. |
| Debugging | Lets you inspect bytes, headers, DOM, and fonts separately. | Fewer controls when diagnosing charset or glyph problems. |
For a footer containing names, legal text, translated labels, or symbols, use footer-html and test the actual PDF output.
A repeatable diagnostic procedure
- Inspect the file bytes. Open and save the footer as UTF-8 in an editor that displays the current encoding. Test with one unmistakable character such as
éor界. - Check the declaration. Confirm
<meta charset="utf-8">or the equivalent HTTP-equiv form appears in the footer head. - Test literal text. If literal text fails, focus on file encoding, response headers, fonts, and the wkhtmltopdf environment.
- Test one substituted value. If literal text succeeds but a parameter fails, log the encoded URL, then verify one-pass
decodeURIComponent(). - Check the response. For a remote footer, inspect HTTP status, redirects, and
Content-Typecharset. - Check fonts. Install coverage for the target language and run as the same account used by the service.
- Reduce the case. Use one input page, one footer, one non-ASCII string, and the exact production command. Record the wkhtmltopdf version, operating system, locale, and architecture.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Accented text is mojibake everywhere | Footer bytes are not UTF-8. | Re-save the file as UTF-8 and declare the charset. |
| Literal Chinese works, parameterized Chinese does not | Deprecated or incorrect URL decoding. | URL-encode the value and use decodeURIComponent() once. |
| Body is correct, footer is blank | Footer URL cannot be loaded or its HTML is malformed. | Test the footer URL from the production host and use a complete document. |
| Boxes replace characters | Missing glyphs in the runtime font. | Install a suitable font and set it in footer CSS. |
| Text disappears only in production | Different build, locale, user, fonts, or response headers. | Compare the complete runtime environment and run the minimal test there. |
Performance and operational notes
A local footer avoids a network dependency and is usually the simplest production choice. A remote footer gives centralized updates but adds DNS, TLS, authentication, and availability failure modes. Keep the footer small, avoid unnecessary scripts, and wait for the page only as long as your layout requires. Cache or reuse a tested template, but do not cache a response whose charset headers or substituted values can vary.
When integrating through the libwkhtmltox API, pass settings as UTF-8 encoded strings and set the web default encoding and footer HTML URL explicitly. The API setting names correspond to the command-line concepts, so apply the same file, decoding, font, and environment checks.
Or skip the browser setup
If your actual requirement is a clean screenshot or PDF of a web page rather than a wkhtmltopdf-specific footer pipeline, ScreenshotNeo provides a single HTTP request. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; and its MCP server lets Claude, Cursor, or another MCP client use take_screenshot, get_page_info, and capture_pdf.
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 documentation for capture options and response headers. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is included on every plan. Sign up free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.FAQ
Can I put the charset only on the main HTML page?
No. The footer is loaded as its own HTML resource, so declare UTF-8 in that document or ensure its HTTP response declares it.
Rank #4
- 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
Should I decode every footer parameter?
Decode values that were URL-encoded for transport, exactly once. Do not apply decoding to already decoded text.
Does a correct charset guarantee every language will render?
No. The selected runtime fonts must also contain the required glyphs, and the production build and service account must match the environment you tested.
Frequently Asked Questions
Can I put the charset only on the main HTML page?
No. The footer is loaded as its own HTML resource, so declare UTF-8 in that document or ensure its HTTP response declares it.
Should I decode every footer parameter?
Decode values that were URL-encoded for transport, exactly once. Do not apply decoding to already decoded text.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchDoes a correct charset guarantee every language will render?
No. The selected runtime fonts must also contain the required glyphs, and the production build and service account must match the environment you tested.
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.

