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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

If a PDF generated by “pdfkit” looks too small, first identify which tool your project actually uses. Node.js PDFKit creates PDFs directly, so check its page size and margins. The Python pdfkit package commonly passes HTML to wkhtmltopdf, where paper dimensions, viewport, DPI, zoom, and smart shrinking can affect the rendered scale. There is no universal DPI or zoom value that fixes every setup; measure the output and change one setting at a time.

First identify which “pdfkit” you have

These two toolchains have similar names but different jobs and controls:

Toolchain What lays out the PDF Where to investigate scale
PDFKit for Node.js The PDFKit library creates pages and draws content. Page size, layout, margins, and any page-specific overrides. PDFKit Getting Started
Python pdfkit with wkhtmltopdf The wrapper invokes wkhtmltopdf to render HTML into a PDF. Paper dimensions, viewport, DPI, zoom, and smart shrinking. wkhtmltopdf usage options

Check your imports, dependencies, and the command or wrapper invocation. If the output comes from HTML, CSS, and a wkhtmltopdf executable, changing PDFKit for Node settings will not fix that renderer’s scaling.

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

Measure the page before changing scale

A PDF can look small for two different reasons: the page itself is smaller than intended, or the page is correct but its content occupies only a small part of it. Compare the PDF’s actual page dimensions with the intended paper size, then compare the content’s dimensions and position with the available page area.

#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)
  • Write down the target paper size and orientation.
  • Check whether the page dimensions in the generated PDF match that target.
  • Check whether margins or a fixed-width HTML layout leave the content area unusually narrow.
  • Record the library and renderer versions, operating system, and relevant settings before testing a change.

This measurement separates a page-geometry problem from a content-scaling problem. Do not begin by copying a DPI value from a different machine or issue report.

Fix page size and margins in Node.js PDFKit

PDFKit’s documented defaults are Letter paper and 72-point margins on each side. One PDF point is 1/72 inch when the default userUnit is 1.0. If you expect A4 or another page size, specify it rather than relying on the default. PDFKit accepts named paper sizes and explicit dimensions in points; A4 is documented as 595.28 × 841.89 points. See PDFKit paper sizes.

Set the document’s page options deliberately

For example, create an A4 portrait document and choose margins that fit the design:

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.
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
const PDFDocument = require('pdfkit');
const fs = require('fs');

const doc = new PDFDocument({
  size: 'A4',
  layout: 'portrait',
  margins: {
    top: 36,
    bottom: 36,
    left: 36,
    right: 36
  }
});

doc.pipe(fs.createWriteStream('output.pdf'));
doc.fontSize(12).text('Content sized for an A4 page.', 36, 36);
doc.end();

The numeric margin values are points. The example uses 36-point margins as an illustration, not a universal recommendation; choose margins appropriate to your content and any printing requirements. PDFKit applies document-level page settings by default, but options supplied to addPage can override them for that page. If only some pages look different, inspect those overrides.

Do not use userUnit as a routine zoom control

PDFKit documents userUnit as a way to scale a page’s physical size without changing the coordinate system. That changes the relationship between page coordinates and physical dimensions; it is not a substitute for choosing the intended paper size and laying out content to fit it. See the PDFKit page-size documentation.

Fix HTML-to-PDF scaling with wkhtmltopdf

For Python’s pdfkit wrapper, inspect the options passed to wkhtmltopdf and the actual renderer invocation. Set the paper geometry first, then investigate the viewport and scale controls. The available options are listed in the wkhtmltopdf usage documentation.

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

Check paper size and dimensions

Verify the paper size with --page-size, or set --page-width and --page-height when using custom dimensions. Also check orientation and margins. A correctly rendered page can still appear to have undersized content if the chosen paper is larger than intended or the HTML layout is constrained to a smaller width.

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

Check viewport-dependent layouts

If the HTML uses responsive CSS, media queries, or width-dependent layout, inspect the viewport settings. The renderer’s viewport can influence which layout rules apply, and a narrow or otherwise unexpected viewport may produce content that does not fit the intended PDF page as you expect. Compare the page’s CSS layout width with the printable content width.

Treat DPI and zoom as measured adjustments

wkhtmltopdf documents a default DPI of 96, while noting that this has no effect on X11-based systems. Its zoom option is documented with a default factor of 1. These are renderer settings, not magic values that guarantee a particular printed size across operating systems and builds. Change one at a time, regenerate the PDF, and measure both page fit and content size.

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

Test smart shrinking carefully

Smart shrinking is enabled by default. The project describes its effect as changing the pixel/DPI ratio. Disabling it may prevent automatic shrinking in some layouts, but community reports also describe layouts that become too large or clipped. After toggling it, inspect page fit, clipping, and pagination rather than judging only the apparent size of one element.

Use a controlled troubleshooting sequence

  1. Identify the renderer. Confirm whether the program uses Node PDFKit directly or Python pdfkit to invoke wkhtmltopdf.
  2. State the intended output. Record target paper size, orientation, expected content dimensions, and whether the PDF is for screen viewing, printing, or both.
  3. Measure the generated page. Compare actual page dimensions with the target and distinguish a wrong-sized page from content that is scaled down within a correctly sized page.
  4. Correct geometry first. In Node PDFKit, set page size and check margins and page overrides. With wkhtmltopdf, confirm paper size or explicit dimensions, orientation, and margins.
  5. Inspect the layout width. For HTML-to-PDF output, check CSS widths and the renderer viewport before adjusting DPI or zoom.
  6. Test one scale control at a time. Change only the relevant DPI, zoom, or smart-shrinking setting, then regenerate and remeasure.
  7. Record the result. Keep the versions, operating system, settings, and measured dimensions with the output so the working configuration can be reproduced.

Common symptoms and what to check

Symptom Likely area to inspect Next check
Every page and its content are smaller than expected Page geometry or a global scale setting Measure the page size; confirm paper dimensions, orientation, and any zoom or viewport configuration.
The page size is right, but content is small and surrounded by excess space Margins, HTML width, or automatic shrinking Check PDFKit margins or, for wkhtmltopdf, content width and smart shrinking.
Some pages look different from others Page-specific settings or changing HTML layout Inspect PDFKit addPage overrides, or the HTML and CSS affecting those pages.
Disabling smart shrinking makes content too large or clipped Layout no longer fits the page at its rendered size Recheck content width, paper geometry, margins, and pagination; do not assume the disabled setting is the complete fix.
A DPI change has no visible effect Platform-specific renderer behavior or another controlling option Check the wkhtmltopdf documentation for the stated X11 limitation, then verify viewport, zoom, page dimensions, and the renderer build.
A fix from another report does not reproduce Different versions, operating system, build, or HTML/CSS Compare the environments and measure the output instead of copying the reported setting.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reliability and cost considerations

Scaling behavior can depend on the renderer version, operating system, build, and HTML/CSS. The wkhtmltopdf documentation establishes which controls are available and describes their stated defaults; user reports establish only that a change helped or failed in those users’ environments. They do not establish a universal DPI/zoom combination. Keep a representative HTML input and compare generated page dimensions and content fit whenever you change the renderer or its environment.

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

When generating many PDFs, fixing the underlying page geometry and layout is more reliable than applying a blanket scale adjustment to every document. A global adjustment that helps one page can cause clipping or extra pages elsewhere.

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

Or skip the browser setup

If your actual task is capturing a web page as a PDF or image rather than debugging a local wkhtmltopdf pipeline, ScreenshotNeo provides a screenshot API and MCP server. One GET request can return a screenshot or PDF. Its clean-shot flow accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. AI agents can use its MCP tools for screenshots, page information, and PDF capture.

Get an API key and see the full options in the ScreenshotNeo documentation. cURL example:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Replace YOUR_API_KEY with your key and change the target URL as needed. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.

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

Frequently Asked Questions

Does changing DPI always fix a small PDF from wkhtmltopdf?

No. The effect depends on the renderer and environment; measure the generated page and content after a controlled change.

What does PDFKit use for page size if I do not specify one?

For PDFKit for Node.js, the documented default is Letter, with 72-point margins on every side.

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.