The fix depends on which “pdfkit” you use. Node PDFKit draws a PDF directly, so a small result usually comes from the page size, margins, or a page-specific override. Python’s pdfkit normally calls the wkhtmltopdf HTML renderer; there, paper dimensions, viewport, DPI, zoom, and WebKit’s smart-shrinking behavior control the apparent scale. Identify the toolchain first, measure the generated page, then change one setting at a time.
1. Identify the PDF toolchain before changing options
“pdfkit” names two different paths. Their settings are not interchangeable.
| Toolchain | Where page dimensions are set | Scale-related checks |
|---|---|---|
| Node PDFKit | PDFDocument constructor or addPage(), using a named size or dimensions in points |
Margins, page overrides, coordinate units, and intentional use of userUnit |
Python pdfkit / wkhtmltopdf |
Renderer options passed by the Python wrapper or command line | Paper size, explicit width/height, DPI, zoom, viewport, and smart shrinking |
Check imports, dependencies, and the invocation
- Node code commonly contains
require('pdfkit')or an ES-module import and createsnew PDFDocument(...). - Python code commonly imports
pdfkitand callspdfkit.from_string(),from_file(), orfrom_url(). - A shell command or wrapper that launches
wkhtmltopdfis using the HTML-rendering route, even if the surrounding application is Python.
Do not apply --zoom or --disable-smart-shrinking to a Node PDFKit document; those are renderer options for wkhtmltopdf.
2. Measure the PDF instead of guessing
A PDF can look small for two different reasons: the physical page is smaller than intended, or the page is correct but the content has been reduced inside it. Measure both.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 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)
- Record the intended paper size (for example, Letter or A4), orientation, margins, and content width.
- Inspect the generated file’s actual media-box/page dimensions with your PDF viewer or a PDF inspection utility.
- Compare the measured content area with the CSS or drawing dimensions used by your program.
- Write down library and renderer versions, operating system, page size, margins, DPI, zoom, viewport, and the viewer used for inspection.
One PDF point is 1/72 inch when the default PDF user unit is 1. A4 is approximately 595.28 × 841.89 points. These are geometric reference values, not a promise that every viewer will display the page at the same screen size.
3. Fix Node PDFKit documents
Set page size and orientation explicitly
Node PDFKit defaults to Letter size and 72-point margins on every side. If your design assumes A4, a borderless page, or a different margin, specify it rather than relying on defaults. The constructor settings apply to new pages unless an individual addPage() call overrides them.
const PDFDocument = require('pdfkit');
const fs = require('fs');
const doc = new PDFDocument({
size: 'A4', // or [width, height] in points
layout: 'portrait',
margins: { top: 36, bottom: 36, left: 36, right: 36 }
});
doc.pipe(fs.createWriteStream('output.pdf'));
doc.fontSize(12).text('Content starts inside the declared margins.');
doc.end();
For a custom page, pass a two-number array in points, such as [612, 792] for Letter portrait. Use layout: 'landscape' when the content is wider than it is tall, or provide dimensions in the desired order.
Look for page-specific overrides
A later call such as doc.addPage({ size: 'LETTER', margins: 72 }) can silently restore a larger margin or different paper size. Search every addPage() call and compare it with the constructor. If only some pages are small, an override is more likely than a global scaling problem.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsRank #2
- 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
Check margins and coordinate calculations
Large margins reduce the usable content rectangle even when the paper itself is correct. Calculate the available width as page width minus left and right margins, and ensure your drawing or table code fits that width. Avoid multiplying coordinates by a browser-style pixel ratio unless you deliberately converted pixels to points.
Use userUnit only for a deliberate physical-scale change
PDFKit exposes userUnit to scale the physical size of a page without changing the coordinate system. It is not a general “make my text bigger” switch. Change it only when you understand how your target viewers and printers handle non-default user units; otherwise set the page dimensions and drawing coordinates directly.
4. Fix Python pdfkit and wkhtmltopdf output
Verify paper geometry first
Set a named paper size or explicit dimensions before tuning scale. Also confirm orientation and margins. A viewport that is wider than the paper can trigger shrinking to make the HTML fit.
import pdfkit
options = {
'page-size': 'A4',
'orientation': 'Portrait',
'margin-top': '12mm',
'margin-right': '12mm',
'margin-bottom': '12mm',
'margin-left': '12mm',
'viewport-size': '1280x900',
'zoom': '1'
}
pdfkit.from_string(html, 'output.pdf', options=options)
The option names above are passed through to wkhtmltopdf. If your layout is intended for a fixed-width desktop viewport, set that viewport deliberately; if it is responsive, test the CSS at the viewport you actually want.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Rank #3
- 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.
Understand DPI and zoom
wkhtmltopdf documents a default DPI of 96, with a note that this has no effect on X11-based systems. DPI affects the renderer’s conversion between CSS pixels and physical output; --zoom applies a zoom factor whose documented default is 1. Neither setting is a universal correction. Change one, regenerate, and measure page fit, text size, and pagination.
Test smart shrinking as an experiment
Smart shrinking is enabled by default. The official option description says it changes the pixel/DPI ratio so content can fit the selected paper. Disabling it may stop automatic reduction:
wkhtmltopdf --page-size A4 --disable-smart-shrinking input.html output.pdf
However, disabling the feature can make content too large, clip the right edge, or create unexpected page breaks. Recheck every page after the change. If the result is worse, remove the flag and investigate viewport width, CSS widths, and paper dimensions instead.
Prefer explicit width and height when the paper is custom
For receipts, labels, or other non-standard pages, use wkhtmltopdf’s page-width and page-height options (with the units supported by your installed build) rather than relying on a browser screenshot width. Keep margins and CSS page rules consistent with those dimensions.
Rank #4
- 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
5. A controlled troubleshooting sequence
- Reproduce with a minimal document. Remove images, JavaScript, custom fonts, and complex CSS. This distinguishes geometry problems from content that changes layout.
- Lock the page. Set paper size, orientation, dimensions, and margins explicitly.
- Lock the viewport (wkhtmltopdf only). Use the viewport that your CSS expects and record it.
- Measure a baseline. Save the PDF and note page dimensions, content bounds, page count, and any clipping.
- Change one variable. Try zoom, DPI, or smart shrinking separately; never change all three and assume the last result identifies the cause.
- Retest the real document. A setting that works for a short sample may clip long tables, images, or footers.
- Record the winning configuration. Include library and renderer versions, operating system, command/options, and measured output in source control or deployment notes.
6. Common symptoms, causes, and fixes
| Symptom | Likely cause | What to try |
|---|---|---|
| Every element is uniformly tiny on a correctly sized page | Content is being shrunk to fit a wide viewport or fixed-width container | Reduce CSS width, set the intended viewport, then test zoom and smart shrinking one at a time. |
| Page itself is the wrong physical size | Default Letter/A4 mismatch or an incorrect custom dimension | Set size (Node) or --page-size/--page-width/--page-height (wkhtmltopdf). |
| Only later Node pages are small | addPage() overrides the constructor |
Remove the override or give every page the intended size and margins. |
| Disabling smart shrinking makes text huge or clips content | The original layout depended on automatic fitting | Restore shrinking, then correct viewport/CSS width and paper geometry. |
| Changing DPI has no visible effect | Platform/build behavior, including the documented X11 limitation, or another setting dominates | Keep DPI fixed and inspect page size, viewport, zoom, and renderer version. |
| Right edge is cut off after a scale change | Content width plus margins exceeds the printable area | Reduce content width or margins, choose landscape, or use a wider page. |
| Different machines produce different scale | Different wkhtmltopdf builds, operating systems, fonts, or default viewport behavior | Pin the renderer, fonts, options, and environment; compare measured files. |
7. Reliability and cost considerations
Renderer behavior depends on the installed wkhtmltopdf version, operating system, build options, HTML/CSS, fonts, and external assets. Historical community reports describe both improvement and remaining mismatch after DPI or smart-shrinking changes; they are environment-specific observations, not guaranteed fixes. Treat each adjustment as a measured experiment.
For automated jobs, wait for fonts and images before rendering, avoid relying on remote assets that can fail intermittently, and retain a representative fixture PDF for regression checks. Compare page dimensions and clipping in continuous integration rather than judging only by a screenshot in one viewer.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If your goal is to obtain a clean PDF or screenshot of a web page rather than debug your own PDF layout, ScreenshotNeo provides a single request API. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks, 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.
For a PDF capture, use the documented API options for paper size, margins, landscape mode, and page ranges. The same service also supports full-page images, element selectors, custom CSS and JavaScript, waiting conditions, headers, cookies, user agents, blocking rules, geolocation, resizing, caching, signed links, asynchronous jobs, and bulk capture. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
See the ScreenshotNeo API documentation for authentication and PDF parameters.
Best Value
- 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
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)
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 Free plan includes 1,000 shots each month without a card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.
FAQ
Is PDFKit’s default page Letter or A4?
Node PDFKit’s documented default is Letter, with 72-point margins on each side. Set A4 or another size explicitly when that is your target.
Should I always disable wkhtmltopdf smart shrinking?
No. It is enabled by default and can be useful for fitting content. Disable it only as a controlled test, then check for clipping, oversized elements, and changed pagination.
Recommended Free Tools
Can userUnit repair a tiny Node PDF?
It changes the physical scale of the page while preserving the coordinate system. It is intended for deliberate page-unit design, not as a first-line correction for wrong margins or page dimensions.
Why does a PDF look different in two viewers?
Viewers may use different zoom, font substitution, print scaling, or page-display settings. Compare the file’s measured page and content dimensions before changing your generator.
Frequently Asked Questions
What is the fastest first check when a PDF is tiny?
Confirm whether the code uses Node PDFKit or Python pdfkit/wkhtmltopdf, then inspect the actual page size and content bounds.
Does increasing DPI guarantee larger text?
No. DPI interacts with renderer and platform behavior; zoom, viewport, CSS width, and smart shrinking may dominate.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick 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.

