Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
Command Line

How to Remove the Table of Contents from wkhtmltopdf’s Table of Contents

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

To remove printed table-of-contents pages, remove the standalone toc object from the wkhtmltopdf command or library object sequence. Use wkhtmltopdf input.html output.pdf, not wkhtmltopdf toc input.html output.pdf. If the unwanted item is the PDF viewer’s bookmark sidebar, disable the separate global outline with --no-outline.

First identify which “table of contents” you want to remove

wkhtmltopdf uses the word “TOC” for two different PDF features. A generated TOC object creates one or more printed pages, usually at the beginning of the document. Independently, wkhtmltopdf can write an outline, which PDF viewers display as bookmarks in a navigation pane. Removing one does not automatically remove the other.

What you see What creates it Correct control Result
Printed contents pages in the PDF A standalone toc object in the input sequence Omit that object No generated contents pages
Bookmarks or a navigation outline in a PDF viewer The global PDF outline setting Use --no-outline or set global outline to false No outline entries in the viewer
Both Both features enabled Omit toc and disable the outline No printed TOC and no bookmark sidebar

Look at the PDF itself before changing options. If you can scroll through a contents page, change the object sequence. If the page is absent but a left-hand bookmarks pane remains, change the outline setting.

Remove printed TOC pages from the command line

Use a normal page object sequence

A basic conversion with no generated TOC is:

wkhtmltopdf input.html output.pdf

The command has one page object, input.html, followed by the output file. There is no toc object, so wkhtmltopdf has nothing to render as contents pages.

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.
#1 Best Overall
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
  • 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.

What creates the unwanted pages

This command explicitly requests a TOC object:

wkhtmltopdf toc input.html output.pdf

Delete the toc token rather than trying to hide its heading, change its caption, or reduce its font size. The TOC is an object in the command’s sequence, not a CSS block inside your source HTML.

Commands with several document objects

Object order matters when you have a cover, chapters, or several HTML files. For example:

wkhtmltopdf cover cover.html toc chapter-1.html chapter-2.html book.pdf

To keep the cover and chapters but remove the generated contents pages, use:

wkhtmltopdf cover cover.html chapter-1.html chapter-2.html book.pdf

Do not remove the chapter objects themselves. Only remove the standalone toc object. If a build script constructs the command as an array, remove the array entry that contains exactly toc and leave the surrounding page objects in their original order.

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

Remove only PDF bookmarks (the outline)

If the PDF has no printed TOC but still opens with bookmarks, keep your page objects and disable the global outline:

Rank #2
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
  • 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.
wkhtmltopdf --no-outline input.html output.pdf

This option affects the outline stored in the PDF file. It does not suppress printed contents pages created by a toc object. To remove both features, omit toc and add --no-outline:

wkhtmltopdf --no-outline input.html output.pdf

That example already has no TOC object; with a multi-object command, apply the same rule while retaining every required page object:

wkhtmltopdf --no-outline cover cover.html chapter-1.html chapter-2.html book.pdf

Option spelling can vary in downstream packages. Run the executable installed on the machine with:

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

The project’s documentation states that the automatically generated help is the same manual shown by that command. Use it to confirm that your build supports --no-outline before changing a deployment script.

How the library settings map to the two features

The TOC object is object-level

In the libwkhtmltox model, a PDF object has a TOC settings structure and fields including tocXsl. The documentation describes tocXsl as selecting a table-of-content object. In a library integration, do not create that object when you do not want printed contents pages. Removing a style, caption, or XSL customization while still creating the object does not remove the pages.

Rank #3
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
  • 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.

The outline is global

PdfGlobal.outline controls whether wkhtmltopdf generates the outline placed in the PDF file. Set this global value to false when the requirement is “no bookmarks.” This setting is separate from the object list, so turning it off does not remove a printed TOC object.

Why includeInOutline is not the TOC switch

PdfObject.includeInOutline controls whether that object’s sections participate in outline or TOC collection. It is not the switch for removing a separately generated TOC object. If you leave a TOC object in the sequence, changing includeInOutline can alter outline participation without preventing the TOC pages from being rendered.

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

Common failed fixes and the precise correction

“I changed the TOC caption, but the pages remain”

Caption, dotted-line, indentation, and font-scale settings customize the appearance of an existing TOC. They do not disable it. Remove the object from the command or object sequence.

“I set includeInOutline to false, but the TOC is still printed”

That field concerns outline participation for a PDF object. Omit the standalone TOC object for printed-page removal; use the global outline setting separately for bookmarks.

“--no-outline did nothing”

Check whether your symptom is printed pages rather than bookmarks. The switch cannot remove pages that were generated by toc. Also run wkhtmltopdf -H to verify the option in the installed build and make sure the option appears before the input and output arguments.

Rank #4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • 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

“The command still shows a TOC after I edited it”

Inspect the actual command emitted by your wrapper, CI job, or shell script. A configuration file or helper may be adding toc after your arguments. Log the final argument list, remove that token, and regenerate the PDF into a new output path so you are not opening an older file.

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

“Bookmarks disappeared, but I wanted to keep them”

Remove --no-outline and leave the global outline setting enabled. You can omit the printed TOC object while retaining bookmarks generated from document headings.

“The option works locally but not in production”

Different distributions and downstream builds may package different wkhtmltopdf versions or patches. Compare wkhtmltopdf -H output and the executable version in both environments. Keep the object sequence and outline decision explicit rather than relying on defaults.

A safe, repeatable workflow

  1. Classify the symptom. Open the PDF and determine whether the unwanted material is printed pages, bookmarks, or both.
  2. Find the final command or object list. Check the wrapper or job that actually launches wkhtmltopdf, not only a template configuration.
  3. Remove the TOC object. Delete the standalone toc entry while preserving covers and content objects.
  4. Decide on bookmarks independently. Add --no-outline or set PdfGlobal.outline to false only when the navigation outline should also disappear.
  5. Confirm supported options. Run wkhtmltopdf -H on the target machine and record the package version.
  6. Regenerate and inspect. Use a fresh output filename, check the first pages, and open the viewer’s navigation pane to verify the intended result.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Version and security considerations

The project’s official downloads page identifies 0.12.6 as its stable series and gives June 11, 2020 as its release date. That page status does not guarantee that every operating-system package or downstream fork is identical, so verify the binary actually deployed in your environment.

The same official page warns: “Do not use wkhtmltopdf with any untrusted HTML – be sure to sanitize any user-supplied HTML/JS, otherwise it can lead to complete takeover of the server it is running on!” Treat HTML, JavaScript, local files, headers, and URLs supplied by users as untrusted. Sanitize them before conversion, isolate the conversion process where appropriate, and avoid assuming that removing a TOC changes this security risk.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
  • 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 screenshot API is a better fit

wkhtmltopdf is appropriate when you need a PDF and control over its document objects. If the actual deliverable is a clean image of a web page, setting up a browser renderer can be unnecessary. ScreenshotNeo is a website screenshot API and MCP server; it is not a replacement for wkhtmltopdf’s PDF outline controls, but it can provide a direct image request for web capture.

Or skip the browser setup

ScreenshotNeo accepts one GET request and returns a PNG, JPEG, WebP, or PDF. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response reports its status in X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo documentation for authentication and all options. A minimal cURL request is:

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

The service includes full-page capture with lazy images loaded, CSS-selector element capture, device presets or custom viewports, dark mode, retina scale, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, authorization, geolocation, time zones, transparent backgrounds, resizing, caching, signed image links, asynchronous jobs, webhooks, bulk capture for up to 100 URLs per call, usage reporting, and an OpenAPI specification.

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

There is a free allowance of 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan, and yearly billing gives two months free. Create a free ScreenshotNeo account to try it without a card.

Quick Recap

Bestseller No. 1
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$99.99
Bestseller No. 2
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
MobiPDF Lifetime - Professional PDF Editor for Windows | Edit, Sign & Convert PDFs | Best Adobe Acrobat Pro Alternative | Lifetime License
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.
$99.99
Bestseller No. 3
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$239.88
Bestseller No. 4
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 5
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
PDF Pro 3 - PDF editor to create, edit, convert and merge PDFs - 100% Compatible with Adobe Acrobat - for Windows 11, 10, 8.1, 7
ALL-IN-ONE SOLUTION – read, edit, convert, merge and protect your PDF files
$29.99

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.