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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Fix a misplaced wkhtmltopdf footer by treating it as a page-layout problem: verify the exact binary and option scope, reserve enough space with --margin-bottom, tune --footer-spacing separately, and inspect the footer document’s own height and margins. Change one setting per render so you can identify whether the fault is in your HTML, the wrapper, or the wkhtmltopdf build.

Know which setting controls what

wkhtmltopdf has separate controls for the page edge, the gap between content and footer, and the footer’s content. Confusing those controls is the most common reason a footer is clipped, too high, or overlaps the body.

Control Purpose Important detail
--margin-bottom Sets the bottom page margin. Reserve enough page area for the footer itself; spacing alone is not a substitute for margin.
--footer-spacing Sets the distance between the body content and footer, in millimeters. The 0.12.6 usage manual documents a default of 0 mm.
--footer-html Loads an external HTML document as the footer. The footer document has its own height, CSS, and whitespace.
--footer-left, --footer-center, --footer-right Creates a simple text footer without a separate HTML file. Use substitution values such as [page] and [topage] where supported by the manual.
--footer-line Adds the footer rule described by the command-line manual. Include it only when the line is part of the intended design.

The upstream wkhtmltopdf 0.12.6 usage manual documents these options and distinguishes global options from per-object options. Put global options in the global options area of the command, not after an input object where a wrapper may interpret them differently.

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

Use a controlled diagnosis

  1. Record the environment. Run wkhtmltopdf --version and save the output. Also record the operating system, wrapper or API, complete command, page size, whether the footer is text or HTML, and the dimensions of the footer document.
  2. Check the build, not just the version number. The upstream manual describes a patched-Qt build, while the Debian Bookworm manpage identifies its package as “not using wkhtmltopdf patched qt.” Options and rendering behavior can therefore differ between installations. Compare your binary with the Debian Bookworm manpage and the upstream manual.
  3. Reduce the case to one footer. Temporarily remove the header, custom CSS, JavaScript, and wrapper defaults. Render a short page with a plain footer. This tells you whether the displacement comes from footer settings or from the document.
  4. Set a deliberate bottom margin. Start with a value that visibly leaves room for the complete footer, then adjust in small steps. There is no universal correct number: required space depends on page size, footer height, content, and the build.
  5. Tune spacing independently. Change --footer-spacing without changing the margin. A larger gap moves the footer away from body content; it does not automatically reserve enough area for a tall HTML footer.
  6. Render after every change. Compare the PDF for clipping at the bottom edge, overlap with the last paragraph, and unexpected movement on pages with different content lengths.

Fix a plain-text footer

Plain text is the fastest way to establish whether positioning works before introducing a footer HTML file. This example uses a centered page counter and explicit bottom-margin and spacing values:

#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
wkhtmltopdf 
  --page-size A4 
  --margin-bottom 22 
  --footer-spacing 4 
  --footer-center "Page [page] of [topage]" 
  input.html output.pdf

The numbers above are starting points for a controlled test, not a universal recipe. Increase the bottom margin if the footer is clipped; adjust spacing if the footer is clear but too close to the body. If the footer disappears, first verify that the option is accepted by your binary and that the command places it in the global options section.

Fix an HTML footer

Inspect the footer document itself

With --footer-html, wkhtmltopdf lays out a separate HTML page. Check its body margin, padding, line height, images, and any empty blocks that add height. Remove unnecessary whitespace and make the footer’s intended height explicit. If its content is clipped, reserve more bottom margin in the main command rather than assuming that --footer-spacing will create the required area.

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    html, body { margin: 0; padding: 0; font: 9pt sans-serif; }
    .footer { width: 100%; text-align: center; }
  </style>
</head>
<body>
  <div class="footer">Page <span class="page"></span> of <span class="topage"></span></div>
</body>
</html>

The usage manual’s HTML example receives page values in the footer/header document and inserts them into elements with matching classes. Keep the footer file minimal while diagnosing; add logos, tables, and scripts only after the basic position is stable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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⁴
wkhtmltopdf 
  --page-size A4 
  --margin-bottom 28 
  --footer-spacing 3 
  --footer-html footer.html 
  input.html output.pdf

When a header changes the footer

Test header and footer as separate variables. Hold the header settings constant while changing the footer, then reverse the test. The API reference documents header spacing as the distance between header and content and warns that excessive spacing can place the header outside the PDF; changing margin.top can correct that condition. The corresponding command-line controls are --header-spacing and --margin-top.

If adding a header makes the footer move, inspect the complete combination of top margin, header spacing, bottom margin, and footer spacing. Do not assume that a header consumes only visual space: its configured spacing changes the page layout used for the body.

Verify option scope in wrappers and APIs

Libraries such as Laravel Snappy and other wrappers may translate settings, apply defaults, or place options in a different scope. Capture the exact command generated by the wrapper if possible and run that command directly. Then compare it with a raw invocation of the binary.

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 libwkhtmltox reference exposes the same concepts through API settings such as margin.bottom and the corresponding footer.* and header.* settings. Its documentation is at wkhtmltopdf libwkhtmltox page settings. A wrapper setting named “footer spacing” may map to a different field or unit, so confirm the generated command or API structure instead of relying on the wrapper’s label.

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.

Build a minimal reproduction

  1. Create a body file containing two short paragraphs and no external assets.
  2. Create a footer file containing one line of text and the page-number spans.
  3. Use a fixed page size and explicit top and bottom margins.
  4. Run the raw binary, bypassing the application wrapper.
  5. If the raw result is correct, compare the wrapper’s command, option names, units, and ordering with the working command.
  6. If the raw result is still wrong, repeat with the plain-text footer. A failure in both tests points toward the build, page settings, or a reproducible rendering issue rather than your footer HTML.

This process isolates input layout, option passing, and binary behavior. It does not prove that any one historical issue applies to your installation.

Common symptoms and fixes

Symptom Likely area to inspect Next action
Footer is clipped at the bottom Insufficient bottom margin or a footer document taller than expected Increase --margin-bottom; remove footer whitespace; render again.
Footer overlaps the last paragraph Footer spacing or body area is too small Increase bottom margin first, then adjust --footer-spacing.
Footer sits too high Excessive spacing, header interaction, or build-specific behavior Hold header settings constant, vary one footer option, and compare a plain-text footer.
HTML footer is missing Unsupported option, wrong scope, inaccessible footer file, or wrapper translation Check wkhtmltopdf --version, run the raw command, and verify the footer path and generated options.
Page numbers are blank Footer HTML does not expose the expected classes or substitution is being used in the wrong footer mode Test --footer-center "Page [page] of [topage]", then restore the HTML footer with matching page elements.
Adding a header changes the result Top margin/header spacing combination Inspect --header-spacing and --margin-top; test with the header removed.
Works on one machine only Different package build, Qt patch level, wrapper, or option support Compare exact version/build output and run the same minimal command on both systems.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Historical reports: useful clues, not universal fixes

Issue reports illustrate why version and option combinations matter. In GitHub issue #1988, a 2014 report described a footer appearing high with --header-spacing 60; the author also reported that adding footer spacing did not change that reproduction. In issue #4724, opened June 17, 2020, a Windows 10 user running 0.12.6 through Laravel Snappy reported different behavior after adding an empty header. Neither report is an independently verified rule for every build. If your symptoms match, reproduce the case with a minimal input before adopting any workaround; an empty header is not a general fix.

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

Performance, reliability, and operational notes

  • Keep diagnostic renders small. A minimal HTML and footer shorten the edit-render-inspect cycle and avoid confusing network assets with margin problems.
  • Prefer deterministic inputs. Fixed page size, explicit margins, local assets, and a pinned binary make comparisons meaningful.
  • Expect build variance. Package maintainers may ship a binary with different Qt behavior or option support than the upstream patched-Qt build.
  • There is no source-backed universal formula. Choose margins from the actual footer height and inspect the generated PDF rather than copying a number from another project.
  • Cost is operational, not a documented license figure here. The practical cost is render time and maintenance of the binary, wrapper, and HTML; the cited manuals and reports do not publish a performance benchmark or failure rate.

Or skip the browser setup

If your actual goal is a clean screenshot or PDF of a web page rather than a wkhtmltopdf-generated document with a custom footer, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. It also offers an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools.

See the ScreenshotNeo documentation for request options. This call captures the target page; it does not repair a wkhtmltopdf command or apply your existing footer HTML.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo includes full-page capture, element selection, device and viewport controls, dark mode, retina scale, PDF paper and margin settings, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user agents, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Its parameter names also accept those used by other screenshot APIs, which can simplify migration.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is available on every plan. Create a free ScreenshotNeo account to try it.

Further reading

Frequently Asked Questions

Where is the official command-line option reference?

Use the wkhtmltopdf project’s 0.12.6 usage manual: wkhtmltopdf usage manual.

Where are the API margin and header/footer fields documented?

The libwkhtmltox page-settings reference documents fields such as margin.bottom and the corresponding header and footer settings: page settings reference.

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.

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.