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

Short answer: wkhtmltopdf 0.12.6 with patched Qt does not document a switch that hides a header only on page one of a normal page object. Use a separate cover object when the first page can be its own document, or try a custom --header-html file that hides its element when the injected page number is 1. The latter is a community technique, not a guaranteed cross-version feature, so inspect the PDF produced by your installed binary.

What wkhtmltopdf officially supports

The 0.12.6 (with patched Qt) usage manual describes headers and footers for ordinary page objects. Relevant options include --header-html, text placements such as --header-left, and --header-spacing. It does not list a first-page-only exclusion switch.

That distinction matters: changing spacing changes the distance between a header and the page content; it does not turn the header off for page one. Likewise, replacing --header-html with --header-left changes the header type, not its page scope.

Choose the layout that matches your document

Approach How it works When to use it Important limitation
Separate cover object Renders a separate webpage before the regular page object. The cover has no headers or footers. Your first page is genuinely a cover, title page, or other independent HTML document. It is a document-structure solution, not conditional suppression on page one of an ordinary page object.
Custom --header-html Runs header HTML for each page and can attempt to hide the header when the page-number value is 1. You need one regular page object and can validate the result on your own build. The relevant example comes from a 2016 user issue; it was not confirmed by maintainers or demonstrated to work across binaries.
Text header options Places simple text with options such as --header-left. You need an ordinary header on every page. The manual does not provide a page-one exclusion for these options.

Option 1: make page one a cover object

This is the most predictable solution when your content allows it. A cover object is a separate webpage and, as the manual states, “does not have headers and footers.” It also does not appear in the table of contents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Brother DCP-L2640DW Wireless Compact Monochrome Multi-Function Printer, Copy, Scan, Duplex, Mobile Printing
  • BEST FOR SMALL BUSINESSES – Engineered for extraordinary productivity, the Brother DCP-L2640DW Monochrome (Black & White) 3-in-1 combines laser printer, scanner, copier in one compact footprint and delivers high-quality black & white prints
  • FAST PRINTER WITH EFFICIENT SCANNING – Produces documents quickly with print speeds up to 36 ppm(2) and scan speeds up to 23.6/7.9 ipm(3) (black/color). A 50-page auto document feeder(4) allows for convenient, time saving multi-page scanning and copying
  • FLEXIBLE CONNECTION OPTIONS – Easily navigate the changing demands of your business with secure multi-device connectivity via built-in dual-band wireless (2.4GHz / 5GHz) and Ethernet. Or connect locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Print, scan, and manage your wireless printer anytime, from almost anywhere from your mobile device. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(5)
  • CHOOSE BROTHER GENUINE TONER – When it’s time to replace your toner, be sure to choose Brother Genuine TN830 or TN830XL replacement toner. And with Refresh EZ Print Subscription Service, you’ll never worry about running out of toner again and you’ll enjoy savings of up to 50%(6) on Brother Genuine Toner. Get started with Refresh today with a Free Trial(1)

1. Create the cover and body files

Save the first-page markup as cover.html and the continuing content as body.html. Do not put the regular header markup in the cover file.

<!-- cover.html -->
<!doctype html>
<html>
<head><meta charset="utf-8"><title>Report cover</title></head>
<body>
  <h1>Quarterly report</h1>
  <p>Prepared 29 September 2026</p>
</body>
</html>
<!-- body.html -->
<!doctype html>
<html>
<head><meta charset="utf-8"><title>Report</title></head>
<body>
  <h2>Summary</h2>
  <p>The regular document starts here.</p>
</body>
</html>

2. Render the cover before the regular page object

wkhtmltopdf cover cover.html body.html report.pdf

The first PDF page comes from cover.html, so the header attached to the regular page object cannot appear there. This works only if splitting the source into objects is acceptable. A cover is not a way to remove a header from the first page while keeping that page inside the same ordinary page object.

3. Check interactions with other objects

If you add a table of contents, keep in mind that covers, pages, and the table of contents are separate wkhtmltopdf objects. Confirm the resulting order and page numbering in the PDF viewer you actually use.

Rank #2
Brother HL-L2405W Wireless Compact Monochrome Laser Printer with Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOMES & HOME OFFICES – Engineered for consistent, premium print quality, the Brother HL-L2405W Monochrome (Black & White) Laser Printer delivers sharp, crisp prints at an affordable price. Prints one-sided documents at speeds up to 30ppm(2)
  • COMPACT, CONNECTED PRINTER – Flexible connection options make this an ideal printer for home use and at-home offices. Securely connect to multiple devices with built-in dual-band wireless (2.4GHz/5GHz) or locally to a single computer via USB interface
  • BROTHER MOBILE CONNECT APP – Manage your printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Enjoy seamless, reliable everyday printing with the 250-sheet paper tray(4) and a manual feed slot that enables printing on envelopes and specialty pape
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

Option 2: try a conditional custom HTML header

A 4 May 2016 project issue shows a user attempting to read the substituted page number in a custom header and hide the header element when that value is 1. The project page is historical, and the upstream repository was archived on 2 January 2023. Treat this as an experiment that must be validated against your installed executable, wrapper, and Qt build.

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

Header file

The following is deliberately conservative JavaScript for older WebKit engines. It looks for a page query parameter and hides the element on page 1. The parameter name and timing are the parts most likely to differ between builds, so inspect your generated output rather than assuming success.

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    body { margin: 0; font: 10pt Arial, sans-serif; }
    #pdf-header { border-bottom: 1px solid #999; padding-bottom: 3mm; }
  </style>
  <script>
    function queryValue(name) {
      var match = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.search);
      return match ? decodeURIComponent(match[1].replace(/+/g, ' ')) : null;
    }
    function applyPageRule() {
      var page = queryValue('page');
      if (page === '1') {
        document.getElementById('pdf-header').style.display = 'none';
      }
    }
    window.onload = applyPageRule;
  </script>
</head>
<body>
  <div id="pdf-header">
    <span>Internal report</span>
    <span style="float:right">Page [page] of [topage]</span>
  </div>
</body>
</html>

Render with --header-html

wkhtmltopdf 
  --header-html header.html 
  --header-spacing 4 
  body.html report.pdf

--header-spacing 4 is measured in millimetres. It only controls the gap between the header area and body content; it is not the conditional rule.

Rank #3
Canon imageCLASS LBP6030w - Monochrome Single-Function Wireless Compact Wireless Laser Printer, 1 Year Limited Warranty, 19 PPM, White - Print Only
  • FAST PRINT SPEEDS: Print up to 19 pages per minute.
  • COMPACT DESIGN: Space-saving, compact design fits anywhere in your home, school or small office.
  • WIRELESS CONNECTIVITY: Print from almost anywhere in your workspace using your compatible mobile device.
  • PAPER CAPACITY: Up to 150 sheets.
  • SUSTAINABILITY: Uses less than 2 watts in Energy Saver mode.

Validate the result

  1. Run wkhtmltopdf --version and record the complete output, including whether the binary reports patched Qt.
  2. Use a short test document that is guaranteed to produce at least three pages. Put an unmistakable word in the header so you can find it quickly.
  3. Open the PDF and confirm that page 1 has no header while pages 2 and 3 do.
  4. Repeat after changing the page size, margins, and header content. A rule that appears to work with one layout can fail if the header is evaluated before the page value is available.
  5. If page 1 still shows the header, capture the header’s received query string (temporarily print it in the HTML) and adjust the parameter check for your build. Remove that diagnostic text from production output.

Because this technique is not documented as a supported first-page switch, do not rely on it without a regression PDF in your deployment or CI process.

Option 3: use ordinary text headers when conditional behavior is unnecessary

For a header that belongs on every page, the text options are simpler:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf 
  --header-left "Internal report" 
  --header-right "Page [page] of [topage]" 
  --header-spacing 4 
  body.html report.pdf

The manual documents substitution values such as [page]. There is no corresponding documented value or switch that means “all pages except page 1.” If you later need a header-free cover, move that page into the separate-cover approach instead of trying to encode page logic in a text option.

Rank #4
Brother HL-L2460DW Wireless Compact Monochrome Laser Printer with Duplex, Mobile Printing, Black & White Output | Includes Refresh Subscription Trial(1), Works with Alexa
  • BEST FOR HOME OFFICES & SMALL TEAMS – Engineered for consistent, premium print quality, the Brother HL-L2460DW Monochrome (Black & White) Laser Printer produces documents that are clear, crisp, and easy to review and share, all at an affordable price
  • COMPACT, CONNECTED, EXCEPTIONALLY EFFICIENT– Connect with built-in dual-band wireless (2.4GHz/5GHz), Ethernet, or to a single computer via USB interface. Prints at speeds up to 36ppm(2), plus automatic duplex printing saves time and reduces paper waste
  • BROTHER MOBILE CONNECT APP – Manage your wireless printer remotely and print from your mobile device anytime, from almost anywhere. Order Brother Genuine Supplies, track toner usage, and complete more work on-the-go(3)
  • VERSATILE PAPER HANDLING – Tackle high-volume black & white printing with the 250-sheet capacity paper tray.(4) The manual feed slot enables printing on envelopes and specialty paper
  • BROTHER IS AT YOUR SIDE – Backed by Brother with a 1-year limited warranty and free online, call, or live chat support for the life of your printer

How to decide between the two real workarounds

  • Choose a cover object when the first page has its own template, does not need to flow from the body, and can be maintained as a separate HTML file.
  • Try custom header HTML when page 1 must remain part of one flowing page object and you can test the exact wkhtmltopdf binary used in production.
  • Do not choose header spacing as a hiding mechanism. It changes geometry and can create a large blank area, but it does not suppress the header.
  • Do not assume wrappers are equivalent. A language package or container image may ship a different wkhtmltopdf release or Qt build from the one used in your local test.

Troubleshooting

Symptom Likely cause What to do
The header remains on page 1. The binary does not pass the page value to the header as expected, or the script runs before substitution. Print the received query string in a temporary header, verify the parameter name, and test with the exact production binary. If it remains unreliable, use a cover object.
All headers disappear. The script matched an empty or unexpected value, or JavaScript failed in the old WebKit engine. Use simple ES5-compatible code, check the browser console is unavailable in your environment, and test the header as a standalone HTML file. Remove the conditional code to confirm the base header works.
Page 1 is blank or has unexpected spacing. The header element is hidden but the reserved header area remains, or the header spacing is too large. Reduce --header-spacing and compare the page geometry. A custom header cannot guarantee that hiding its element also removes every reserved layout dimension; the cover method avoids this ambiguity.
The cover has a header. The command attached --header-html to the cover invocation or the first page is actually part of the regular page object. Use the multi-object syntax with cover cover.html, keep the header option for the regular page object only where your command structure supports it, and inspect object boundaries in the output.
Results differ between machines. Different wkhtmltopdf versions, patched-Qt status, wrappers, fonts, or resource-loading conditions. Record wkhtmltopdf --version, pin the executable/container, and keep a known-good PDF fixture for comparison.
Page numbers are wrong after adding a cover. A cover is a separate object, so numbering and table-of-contents behavior may differ from a single flowing page object. Check the generated PDF’s numbering requirements before adopting the cover design; if continuous numbering is essential, validate the custom-header route instead.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reliability, maintenance, and cost considerations

The cover approach adds an explicit document boundary but uses the behavior the manual describes, making it easier to reason about during upgrades. Its trade-off is editorial: the cover cannot share normal-page flow automatically. The custom-header approach keeps one flow, but its JavaScript depends on implementation details that the manual does not promise. Every upgrade of wkhtmltopdf, its Qt build, or a wrapper should therefore trigger a PDF regression check.

Neither workaround requires a paid service; the processing cost is the compute and maintenance of the wkhtmltopdf job you already run. Keep test fixtures small for quick checks, then test a realistic multi-page document because page-number substitution and header layout are inherently page-dependent.

Or skip the browser setup

If your actual requirement is a clean image or PDF capture of a webpage rather than preservation of a wkhtmltopdf document flow, ScreenshotNeo provides a single-request alternative. It accepts the cookie or consent banner like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and reports whether a response was billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

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

See the ScreenshotNeo API documentation for authentication and options. A one-call example is:

Best Value
HP LaserJet M110w Wireless Black & White Printer, Print, Fast speeds, Easy Setup, Mobile Printing, Best-for-Small Teams
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing professional-quality black & white documents and reports. Perfect for 1-3 people
  • WORLD'S SMALLEST LASER IN ITS CLASS – Precision laser printing that fits anywhere
  • FAST PRINT SPEEDS – Up to 21 black-and-white pages per minute single-sided
  • WIRELESS WITH SELF-RESET – Helps you stay connected
  • PRINT FROM ANY DEVICE – Wireless printing from any mobile device, PC or tablet. Works with Microsoft, Mac, AirPrint, Android, Chromebook and more
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same request in Python:

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

And in 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}`);

ScreenshotNeo returns PNG, JPEG, WebP, or PDF and includes headers identifying the page verdict and billing status. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account to try it.

Frequently Asked Questions

Does a cover object count in the table of contents?

The wkhtmltopdf manual describes a cover as a separate object that does not appear in the table of contents. Verify the final ordering if you also generate a table of contents.

Can I guarantee the JavaScript header trick in a container image?

No. The documented manual does not promise a first-page condition, and the historical issue example was not confirmed across binaries. Pin and test the exact image and executable you deploy.

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.

What should I record when reporting a rendering bug?

Include the complete wkhtmltopdf --version output, patched-Qt status, the exact command, a minimal HTML/header pair, and the generated PDF. Those details distinguish a layout problem from a version or wrapper difference.

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.