iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use wkhtmltopdf’s --footer-left, --footer-center, or --footer-right options for a simple repeating footer. For logos, legal text, multiple lines, or custom page-number layout, use --footer-html. In both cases, reserve space with --margin-bottom and adjust --footer-spacing so the footer does not overlap the document.
Choose the right footer method
wkhtmltopdf applies footer settings to the pages it renders from an HTML document or URL. The practical choice is between a text footer and an HTML footer.
| Requirement | Use |
|---|---|
| Short text aligned left, center, or right | --footer-left, --footer-center, or --footer-right |
| Current and final page numbers | Text footer with [page] and [topage] |
| Logo, colors, several elements, or custom layout | --footer-html footer.html |
The footer options are documented in the wkhtmltopdf usage documentation. The values below are examples; choose a bottom margin that is taller than your actual footer and inspect the generated PDF.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Add a simple text footer
This command places a centered page count on every applicable page:
#1 Best Overall
- EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
- READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
- CREATE, COMBINE, SCAN and COMPRESS PDFs
- FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
- LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.
wkhtmltopdf
--margin-bottom 18mm
--footer-spacing 4
--footer-center 'Page [page] of [topage]'
input.html output.pdf
[page] is replaced with the current page number and [topage] with the final page count. You can put ordinary text around those placeholders.
Left, center, and right alignment
Use one of the three alignment flags:
wkhtmltopdf --margin-bottom 15mm
--footer-left 'Internal use only'
input.html output.pdf
wkhtmltopdf --margin-bottom 15mm
--footer-center 'Page [page] of [topage]'
input.html output.pdf
wkhtmltopdf --margin-bottom 15mm
--footer-right 'Example Corporation'
input.html output.pdf
Do not combine multiple footer alignment flags when you intend a single value in one position. If you need separate left, center, and right content in one row, an HTML footer gives you more predictable control.
Footer font and line options
The command-line manual also documents footer font, font size, color, and line-related options. Names and availability depend on the installed wkhtmltopdf build, so check that build’s wkhtmltopdf --extended-help output before adding less-common switches. A basic page-count footer is usually easier to maintain than a long command containing many presentation flags.
Free tools Windows power users keep installed
One-click scans. No signup required.
Build a custom HTML footer
Use --footer-html when the footer needs markup or a layout that text flags cannot express. The footer document receives values as URL query parameters. The documented pattern reads the page and topage parameters and inserts them into elements with matching classes.
Rank #2
- Edit PDFs with Ease. Modify text, images, and layouts directly within your PDF documents.
- Convert & Organize. Export PDFs to Word, Excel, or ePub, and organize files with ease.
- Read & Annotate. Enjoy intuitive reading modes and powerful tools to comment, highlight, and mark up PDFs.
- Create & Manage PDFs. Create new PDFs, combine multiple files, scan documents, and compress for easy sharing.
- Fill & Sign Forms. Complete forms and digitally sign documents with secure e-signature tools.
Create footer.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
function subst() {
const vars = {};
const parts = document.location.search.substring(1).split('&');
for (const part of parts) {
const pair = part.split('=', 2);
vars[pair[0]] = decodeURI(pair[1]);
}
for (const name of ['page', 'topage']) {
const elements = document.getElementsByClassName(name);
for (const element of elements) {
element.textContent = vars[name];
}
}
}
</script>
</head>
<body style="border:0; margin:0" onload="subst()">
<div style="width:100%; text-align:center; font:10px Arial, sans-serif;">
Page <span class="page"></span> of <span class="topage"></span>
</div>
</body>
</html>
The JavaScript runs when wkhtmltopdf loads the footer page, reads its query string, and fills the two spans. You can add a logo, borders, columns, or other static markup, but keep the footer’s height predictable. External assets must be reachable by the converter; a local image should use a valid path or a file URL appropriate to your environment.
Convert with the HTML footer
wkhtmltopdf
--margin-bottom 18mm
--footer-spacing 4
--footer-html footer.html
input.html output.pdf
If your input is a URL, replace input.html with that URL. If the footer is hosted elsewhere, provide its URL instead of the local filename. Verify that the converter process can access the file, especially when it runs inside a container, service account, or restricted working directory.
Reserve enough space
Bottom margin
--margin-bottom creates the page area needed by the footer. An 18 mm value is only an illustration, not a universal default. Measure the rendered footer, account for its font size and line wrapping, and increase the margin if the footer is clipped or content reaches it.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsFooter spacing
--footer-spacing controls the gap between the footer and the document content. Increase it when content sits too close to the footer; decrease it when the footer is unnecessarily far away. Changing spacing does not replace a sufficient bottom margin.
Rank #3
- Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
- Edit text and images without jumping to another app.
- E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
- Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.
Inspect the PDF
Render a representative document containing short pages, long pages, headings, tables, and the final page. Check the first, middle, and last pages at normal zoom and when printed. A footer that looks correct on a short sample can collide with content after a page break or wrap to a second line.
Page objects, covers, and option scope
wkhtmltopdf commands can contain multiple page objects, a table of contents, and a cover. The manual distinguishes global options from options placed in page-option areas; put an option where it applies to the relevant object and confirm behavior with your installed version.
A cover object is an explicit exception: the manual says a cover “does not have headers and footers.” Do not expect a footer flag to appear on a cover. If every content page needs a footer, treat the cover separately or place the cover’s information in its own HTML content.
Library API equivalents
Applications using libwkhtmltox configure the same concepts through settings rather than command-line switches. The page settings reference documents margin.bottom, footer settings, and pageOffset. The HeaderFooter API reference describes alignment, font, line, HTML URL, and spacing fields.
Rank #4
- Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
- EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
- READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
- CREATE, COMBINE, SCAN and COMPRESS PDFs.
- FILL forms & Digitally Sign PDFs. Work with Digital certificates
Use the API when your application already owns PDF generation and needs to set footer values programmatically. Keep the same layout rule: the bottom margin must accommodate the footer, and page-number offsets must be intentional if numbering should begin at a value other than one.
Troubleshoot missing or overlapping footers
The footer is missing everywhere
- Confirm that the option is spelled correctly and supported by the installed build.
- Check whether it was placed in the correct global or page-option scope.
- For
--footer-html, verify the path or URL and ensure the converter process can read it. - Confirm that you are not rendering a cover object, which does not receive headers or footers.
- Run
wkhtmltopdf --extended-helpand compare the available options with your command.
The footer overlaps document content
- Increase
--margin-bottomto make a taller footer area. - Increase
--footer-spacingto add a gap. - Reduce footer font size or prevent long text from wrapping.
- Inspect pages containing tables, images, and forced page breaks; those often expose insufficient space.
Page numbers are blank in an HTML footer
- Ensure the footer’s JavaScript runs on load.
- Use the exact
pageandtopagequery-parameter names used by the documented pattern. - Make sure the HTML contains elements with classes
pageandtopage. - Check that a restrictive local-file or JavaScript setting in your build is not preventing the footer from loading or executing.
The footer works locally but not in production
Compare the wkhtmltopdf executable and version, working directory, permissions, URL access, fonts, and security settings. A service account or container may not be able to read a relative footer path that works in an interactive shell. Use an absolute path or an accessible URL, then inspect the generated PDF rather than relying only on a successful process exit.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability, and maintenance
A text footer adds little layout complexity. An HTML footer can require loading a document, styles, fonts, and images on every conversion, so keep it small and self-contained when possible. Avoid unnecessary remote assets: network failures can make a footer incomplete even when the main document renders.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Pin and document the wkhtmltopdf build used by your deployment. Footer behavior can vary with packaging, patched Qt builds, available fonts, and option support. Include a PDF smoke test in production changes that checks footer presence, page numbering, and overlap on a multi-page fixture.
Best Value
- ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
- MAXIMUM FUNCIONALITY – create interactive forms, compare PDFs, bates numbering, find and replace text or colors, convert documents, OCR engine, comment, highlight, fill out and print forms, document protection and others
- EASY TO INSTALL AND USE – well-structured user-interface, in-program instructions, free tech support whenever you need it
- GREAT VALUE FOR MONEY - why spend a fortune if you can have maximum functionality at a reasonable price - this also fits the requirements of companies very well
When a document has a cover, table of contents, and several page objects, test each object independently. A setting that applies globally may not have the effect you expect in a page-specific option area.
Or skip the browser setup
If your actual goal is a clean screenshot or PDF of a web page rather than controlling a local wkhtmltopdf conversion, ScreenshotNeo makes one GET request to capture it. Its service accepts cookie and 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 result with X-Page-Verdict and X-Billed headers. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
For a WebP response, use the documented endpoint and parameters:
Recommended Free Tools
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 options such as full-page capture, CSS-selector element capture, dark mode, device presets, retina scale, PDF paper size and margins, custom CSS or JavaScript, clicks, waits, blocked requests, cookies, headers, timezone, geolocation, transparent backgrounds, resizing, cache TTL, signed links, asynchronous webhooks, bulk capture, and usage reporting.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account to try it.
Frequently Asked Questions
Can a wkhtmltopdf cover page have the same footer as the other pages?
No. The manual explicitly excludes headers and footers from a cover object. Add cover information in the cover HTML or handle that page separately.
Should I use a text footer or an HTML footer for page numbers?
Use a text flag for a straightforward “Page [page] of [topage]” line. Use HTML when the page number is part of a richer layout or needs custom styling.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Why does changing footer spacing not fix clipping?
Spacing changes the gap, while the bottom margin provides the reserved area. Increase the margin when the footer itself needs more room.
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.

