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

Use jsPDF’s html() plugin to convert a DOM element, configure the plugin’s automatic paging for the exact jsPDF version installed, and save the file only after the conversion callback or promise resolves. Do not expect addPage() or setPage() to repair a tall HTML render: those APIs manage document pages, while the HTML plugin decides how content flows across them.

What actually controls HTML pagination

There are two separate mechanisms in jsPDF:

  • HTML conversion: doc.html() uses the HTML plugin. That route relies on html2canvas, and string HTML input also involves DOMPurify.
  • Document page management: addPage() creates and activates a page, while setPage(number) selects an existing page. They do not define how a tall DOM tree is divided during HTML conversion.

The HTML plugin exposes its paging behavior through pdf.context2d.autoPaging. Option names, accepted modes and defaults can vary with the version you have installed, so inspect the matching plugin source or documentation rather than copying a setting from a different release. The rolling project documentation is not a version-pinned compatibility promise.

Check the version and dependencies first

Confirm the package you are running

In a package-managed project, inspect the resolved jsPDF version with your package manager (for example, npm ls jspdf) and check that the imported build includes the HTML plugin. Lock the version in your project so a later dependency update does not silently change pagination behavior.

Load the required browser libraries

The browser build must have jsPDF’s HTML functionality and its rendering dependencies available. html2canvas performs the browser-side rasterization and layout work. If you pass an HTML string instead of a live element, the route also uses DOMPurify to sanitize that input. A missing dependency commonly produces a blank document, an exception, or an HTML method that is undefined.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

Prepare a real DOM element

Render the content in the document before calling html(). Give the container an explicit width, use loaded web fonts and images, and avoid measuring an element while it is hidden with display:none. A detached or zero-size element gives the renderer no useful layout dimensions.

Reliable multi-page pattern

The following browser example keeps all follow-up work inside the completion callback. Adjust the paging option to the syntax supported by your installed jsPDF and HTML plugin; verify the exact mode in that version before shipping.

import { jsPDF } from 'jspdf';

const source = document.querySelector('#invoice');
if (!source) throw new Error('Missing #invoice element');

const pdf = new jsPDF({
  unit: 'pt',
  format: 'a4',
  orientation: 'portrait'
});

// Confirm the accepted value for your installed version.
pdf.html(source, {
  margin: [36, 36, 36, 36],
  autoPaging: 'text',
  html2canvas: {
    scale: 2,
    useCORS: true
  },
  callback: function (finishedPdf) {
    // Save only after HTML conversion has completed.
    finishedPdf.save('invoice.pdf');
  }
});

Some releases expose the paging setting through the HTML options; the implementation also surfaces it as pdf.context2d.autoPaging. If your installed release does not recognize autoPaging in the options object, inspect that release’s plugin implementation and use the supported configuration instead of assuming this example is universal.

Promise-style completion

Where your installed API supports a promise, await conversion before reading page count, drawing additional content or saving:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await pdf.html(source, {
  margin: 36,
  autoPaging: 'text'
});
pdf.save('invoice.pdf');

Use the callback form when in doubt because the official example demonstrates that completion path. The important rule is not to call save(), inspect the finished page structure, or add dependent drawing commands before rendering has ended.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

Design the HTML so page breaks are predictable

Give the layout a stable page width

Choose a content width that fits the PDF page after margins. Responsive layouts that change width during capture can move text and images between pages. Prefer a dedicated print container rather than capturing an application shell with sidebars, sticky navigation and live controls.

Keep blocks together where possible

Tables, cards and headings can land close to a page edge. Group a heading with its first paragraph, and avoid extremely tall single elements that cannot fit on one page. The reviewed sources do not establish one universal CSS page-break recipe across jsPDF versions, so test the actual DOM and version rather than relying on a particular break-inside or page-break-* rule as a guarantee.

Wait for fonts and images

Call the converter only after web fonts have loaded and images have usable dimensions. Cross-origin images may require appropriate CORS headers and the corresponding html2canvas configuration. A late-loading image can change the layout after the renderer has measured it, producing overlaps or unexpected splits.

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

Control large or dynamic content

Virtualized lists often contain only the visible rows in the DOM. Expand or render all rows before capture. For charts or canvases, wait until drawing is complete. Hide buttons and interactive controls in the capture container instead of removing them from the application state.

Automatic flow versus explicit pages

Approach Best use Trade-off
HTML plugin with automatic paging Reports, invoices and documents whose content is already represented by browser HTML Less manual code, but exact splits depend on the installed jsPDF/html2canvas behavior and the rendered CSS
Manual page construction Highly art-directed PDFs with fixed sections and known dimensions Maximum placement control, but you must measure content and add pages yourself
Hybrid HTML body plus deliberate headers, footers or overlays Requires strict ordering: wait for HTML completion before drawing dependent elements

Use addPage() when your own code has decided that a new page is needed. Use setPage(n) when you need to select a page that already exists. Neither call changes the HTML plugin’s internal decision about where a DOM element is split.

Diagnose clipped, blank or incorrectly split output

The PDF is blank

  • Confirm the selector returns an element and that it has non-zero width and height.
  • Ensure the HTML plugin and html2canvas are present in the browser build.
  • Do not capture an element that is still hidden or whose content is inserted asynchronously.
  • Check the browser console for cross-origin image errors and JavaScript exceptions.

Only the first page appears

  • Verify that automatic paging is enabled using the option or property supported by your exact version.
  • Make sure you are not saving before the callback or promise resolves.
  • Check whether a parent element applies a fixed height or clipping overflow that hides the remainder before capture.

Content is clipped at the bottom

  • Reduce the capture width or margins so the effective page geometry matches the DOM layout.
  • Inspect elements that are taller than a page; split them into smaller sections when they cannot sensibly be kept together.
  • Compare output at the exact jsPDF version used in production; behavior near page boundaries is version- and layout-dependent.

Text or images overlap

  • Wait for fonts, images and charts before conversion.
  • Remove transforms, sticky positioning and animated layout changes from the print container.
  • Try a different html2canvas scale only after the layout is stable; scale changes rasterization quality and memory use, not the underlying pagination rules.

Page breaks differ between browsers

Capture in a controlled browser environment when identical PDFs matter. Browser font availability, image dimensions, device scale and the actual DOM all affect the measured layout. Treat a visual comparison of representative long documents as part of release testing.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

Verify the generated PDF

  1. Open the file and count pages.
  2. Check that headings are not stranded at the bottom of a page and that tables continue in the intended order.
  3. Inspect the first and last few lines on every page for clipping.
  4. Test long text, missing images, web fonts, right-to-left or localized strings if your application supports them.
  5. Repeat the test after every jsPDF or html2canvas upgrade.

There is no universal CSS or autoPaging value that guarantees the same result for every document. Record the jsPDF version, browser, page format, margins and representative HTML alongside your visual tests so a regression has a reproducible cause.

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

Or skip the browser setup

If you need a finished page image or PDF rather than a client-side jsPDF document, ScreenshotNeo accepts one request for a URL. It can accept consent banners before capture and remove more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response reports the page verdict and billing status in headers.

It also provides an MCP server for AI agents, with take_screenshot, get_page_info and capture_pdf tools. Every plan includes features such as full-page capture with lazy images loaded, CSS-selector element capture, custom CSS and JavaScript, waits, request blocking, headers and cookies, device and viewport controls, PDF page settings, caching, signed links and bulk capture.

One-call example

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

See the ScreenshotNeo API documentation for all parameters and response headers. Equivalent Python and Node.js calls are:

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 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing provides two months free. Create a free ScreenshotNeo account to try it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently asked questions

Can I use addPage() after every HTML section?

You can construct a document manually that way, but calling addPage() does not tell an in-progress HTML render where to split. Choose either a deliberate manual layout or the plugin’s automatic flow, and coordinate them only after conversion completes.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art

Should I pass an HTML string or an element?

A live, fully laid-out element is usually easier to reason about because its computed dimensions and loaded assets already exist. String input follows the sanitizer path and still needs a complete, measurable document and the dependencies supported by your installed version.

Why did an option copied from a blog fail?

jsPDF’s master documentation changes over time, while your application may be pinned to an older release. Check the installed version and its matching HTML plugin implementation before relying on an option name, paging mode or CSS behavior.

Frequently Asked Questions

Can I use addPage() after every HTML section?

You can construct a document manually that way, but calling addPage() does not tell an in-progress HTML render where to split. Choose either a deliberate manual layout or the plugin’s automatic flow, and coordinate them only after conversion completes.

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

Should I pass an HTML string or an element?

A live, fully laid-out element is usually easier to reason about because its computed dimensions and loaded assets already exist. String input follows the sanitizer path and still needs a complete, measurable document and the dependencies supported by your installed version.

Why did an option copied from a blog fail?

jsPDF’s master documentation changes over time, while your application may be pinned to an older release. Check the installed version and its matching HTML plugin implementation before relying on an option name, paging mode or CSS behavior.

Quick 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.