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

If a wkhtmltopdf PDF looks too small, start by making the paper size and margins explicit. Then test scale controls (--dpi, --zoom, and smart shrinking) one at a time. Set --viewport-size only for the browser layout viewport, and reproduce the same command, binary, operating system, and fixture before comparing results.

Start with a reproducible diagnosis

“Too small” can describe different failures: the entire page is uniformly reduced, a wide layout is shrunk to fit, text changes between machines, or the PDF uses the wrong physical sheet. Treat each as a separate variable instead of changing several flags at once.

  1. Record the complete wkhtmltopdf command, installed binary version, operating system, and build details.
  2. Save the exact HTML, CSS, and JavaScript fixture and the resulting PDF.
  3. Write down the intended paper size, margins, physical measurements, expected page count, and the machine that produced the reference output.
  4. Change one setting, render again, and record the new measurements and page count.

The wkhtmltopdf project describes the tool as an open-source command-line renderer that uses Qt WebKit. Its graphics environment therefore matters even when the process runs without a visible desktop.

Set the PDF paper size explicitly

The default rendered page size is A4. That is not the same thing as the browser window used to lay out the HTML. Use --page-size for a standard sheet, or specify both dimensions for a label, receipt, or other custom stock.

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.

Standard paper

wkhtmltopdf --page-size A4 input.html output.pdf
wkhtmltopdf --page-size Letter input.html output.pdf
wkhtmltopdf --page-size Legal input.html output.pdf

Custom paper

wkhtmltopdf --page-width 100mm --page-height 150mm input.html output.pdf

Do not mix an assumed paper size with an unexamined margin configuration. All four margins reduce the width and height available to your content. Set them explicitly when physical placement matters:

wkhtmltopdf --page-size A4 
  --margin-top 10mm --margin-right 10mm 
  --margin-bottom 10mm --margin-left 10mm 
  input.html output.pdf

Use the units required by your production specification and keep them identical across environments. If the output is a label or another nonstandard sheet, custom width and height are more reliable than trying to force a standard page to behave like one.

Understand the scale controls

Three settings are commonly confused. The documented defaults are 96 DPI, zoom 1, and smart shrinking enabled.

Control What it changes Useful diagnostic
--dpi The rendering DPI used when converting layout units to output. Test an explicit value when every element is consistently too large or too small.
--zoom A multiplicative zoom applied to the rendered page. Adjust proportional size after paper geometry is fixed.
Smart shrinking Allows wide content to be scaled down so it fits the printable page. Compare the default with --disable-smart-shrinking when a wide layout is unexpectedly reduced.

Test DPI without guessing

A report that --dpi 300 improved one case is a test result, not a universal correction. Build a small matrix around your current command, for example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --dpi 96  input.html out-96.pdf
wkhtmltopdf --dpi 150 input.html out-150.pdf
wkhtmltopdf --dpi 300 input.html out-300.pdf

Measure the same feature in each PDF. If only one value matches the physical specification, document why that value is required and keep it in the deployment command. Changing DPI can alter apparent text and image scale; it should not be used as a substitute for selecting the correct paper.

Rank #2
Sale
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.

Use zoom as a separate experiment

With page size, margins, and DPI held constant, test zoom values such as 0.9, 1, and 1.1:

wkhtmltopdf --dpi 96 --zoom 0.9 input.html zoom-09.pdf
wkhtmltopdf --dpi 96 --zoom 1   input.html zoom-10.pdf
wkhtmltopdf --dpi 96 --zoom 1.1 input.html zoom-11.pdf

Keep the value that matches the intended physical measurement, not merely the one that looks best at a particular screen magnification.

Check smart shrinking deliberately

Smart shrinking is enabled by default. When a page is wider than the printable area, it can make the whole layout appear smaller. Compare the default with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --disable-smart-shrinking input.html no-shrink.pdf

The result is layout-dependent. Disabling the feature may preserve the designed scale while introducing horizontal overflow or additional pages, so inspect clipping, line wrapping, and page count after the change.

Keep viewport size separate from paper size

--viewport-size emulates the browser window used for HTML and responsive-CSS layout. It does not choose the physical PDF sheet. A page can use a desktop breakpoint while still being printed on A4, or use a narrow breakpoint while printing on a custom page.

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.
wkhtmltopdf --viewport-size 1280x900 
  --page-size A4 input.html output.pdf

Set the viewport when your fixture depends on media queries, overflow behavior, or custom scrollbars. Use the width and height that correspond to the intended layout state, then control physical output separately with --page-size, explicit dimensions, and margins.

Account for operating-system and build differences

Identical HTML and nominal flags can produce different apparent scale on different machines. The project’s issue discussion notes that wkhtmltopdf still uses the underlying graphics library in headless operation. Windows display DPI can affect text rendering, while a Linux patched-Qt path in the cited historical environment used a hardcoded assumption.

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

For a meaningful comparison, hold these variables constant:

  • wkhtmltopdf binary version and build (including whether it is a patched-Qt build);
  • operating system and architecture;
  • Windows display scaling or DPI settings, when applicable;
  • fonts installed and available to the rendering process;
  • the complete command line and all input assets.

When production must run on a different platform, render the minimal fixture there rather than assuming a workstation result will transfer exactly.

A reliable troubleshooting workflow

  1. Freeze the fixture. Use one small HTML file with the CSS and JavaScript needed to reproduce the size problem. Keep external assets under the same conditions for every run.
  2. Fix paper geometry first. Add the intended --page-size, or both custom dimensions, and explicit margins.
  3. Fix the layout viewport. If responsive rules are involved, add --viewport-size WIDTHxHEIGHT that represents the desired browser layout.
  4. Test one scale variable. Run a short DPI matrix, then a zoom matrix. Do not change both in the same experiment.
  5. Compare smart shrinking. Render once with the default and once with --disable-smart-shrinking if wide content is being reduced.
  6. Repeat on the target platform. Include the exact binary and operating-system settings used by the server or build worker.
  7. Measure rather than eyeball. Check physical dimensions, a known reference element, line wrapping, clipping, and page count after every change.
  8. Save the winning command. Put the final flags beside the fixture so a later change can be traced to a specific variable.

Diagnose by symptom

Everything is uniformly too small

Confirm the paper size and margins first. Then test explicit DPI and zoom values while leaving all other settings unchanged. A global change points to scale or geometry; changing CSS widths alone may hide the underlying configuration.

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

Only wide pages are reduced

Smart shrinking is the first suspect. Compare the default with --disable-smart-shrinking, then inspect the viewport width, printable width after margins, and any fixed-width elements. A no-shrink result that overflows is evidence that the layout is wider than the chosen sheet, not proof that the flag is universally correct.

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

The same fixture differs between a workstation and a server

Capture the binary version, build, operating system, display-DPI settings, fonts, and complete command from both machines. Re-run a minimal fixture on each. If the difference follows the platform, standardize the rendering environment instead of adding unexplained scale multipliers.

The page count changes after a size adjustment

Recheck margins, smart shrinking, viewport width, and line wrapping. Page count is a useful signal because a setting that makes content physically larger can legitimately push blocks onto additional sheets.

Reference commands

This template makes the principal choices visible for a standard A4 document:

wkhtmltopdf 
  --page-size A4 
  --margin-top 10mm --margin-right 10mm 
  --margin-bottom 10mm --margin-left 10mm 
  --viewport-size 1280x900 
  --dpi 96 
  --zoom 1 
  input.html output.pdf

For a custom sheet, replace --page-size A4 with --page-width and --page-height. Add --disable-smart-shrinking only when your comparison shows that default shrinking is responsible for the reduction.

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.
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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture a URL as an image or PDF rather than maintain a wkhtmltopdf browser environment, ScreenshotNeo provides a single HTTP request. It accepts cookie and consent banners like a visitor, removes more than 60 known consent platforms plus newsletter popups and chat widgets before capture, and lets each cleanup step be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; each response reports the page verdict and billing status in X-Page-Verdict and X-Billed headers.

See the ScreenshotNeo API documentation for request options. A basic capture is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.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://example.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://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also supports PDF output, full-page captures with lazy images loaded, CSS-selector element captures, dark mode, device presets or custom viewports, retina scale, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, cache TTLs, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting, and an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI clients.

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 available on every plan. Create a free ScreenshotNeo account to try it without a card.

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.

Frequently Asked Questions

Can ScreenshotNeo replace a local wkhtmltopdf binary for private files?

No. ScreenshotNeo is an HTTP capture service for reachable URLs and supported API inputs, while wkhtmltopdf remains a local command-line renderer. Choose the local binary when the source must stay inside your own environment.

What should I preserve for a future size regression test?

Keep the minimal HTML/CSS/JavaScript fixture, the exact command, binary version and build, operating-system details, expected physical dimensions, and a known output PDF together.

Is 300 DPI the correct permanent setting?

Not automatically. It improved one reported case, but DPI is a configuration variable; select it only after measuring your own fixture against the required physical dimensions.

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
SaleBestseller 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.
$74.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.

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