October 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 ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
JavaScript

How to Prevent Bottom Content Being Cut Off in Multi-Page jsPDF PDFs

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

Prevent bottom-edge clipping in jsPDF by checking each block’s measured height against the page’s usable bottom boundary before drawing it. Keep page dimensions, margins, and cursor positions in the same units; after addPage(), reset the cursor to the top margin. For tables, let jsPDF-AutoTable handle pagination and continue from doc.lastAutoTable.finalY instead of estimating where the table ended.

Why jsPDF content gets cut off at the bottom

jsPDF draws at coordinates you provide; it does not automatically move arbitrary text or graphics to a new page. If your current vertical position plus the height of the next block exceeds the printable area, that block can run past the page edge. A bottom margin is useful only if your layout code actually checks against it.

Several common mistakes cause the same symptom: using page height from one unit system and y positions from another, estimating wrapped-text height by character count, forgetting to reset y after addPage(), or drawing follow-on content at an assumed table endpoint. A page can look mostly correct while its last line or table row is clipped or missing.

Set up a consistent page coordinate system

Choose a jsPDF unit, then use it consistently for page dimensions, margins, text positions, and calculated heights. The example below uses millimetres and A4. Its top and bottom margins are reserved explicitly, and its printable bottom is the page height minus the bottom margin.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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)
import { jsPDF } from 'jspdf';

const doc = new jsPDF({ unit: 'mm', format: 'a4' });
const margin = { top: 15, right: 15, bottom: 18, left: 15 };
const pageWidth = doc.internal.pageSize.getWidth();
const pageHeight = doc.internal.pageSize.getHeight();
const usableBottom = pageHeight - margin.bottom;
const contentWidth = pageWidth - margin.left - margin.right;
const lineHeight = 5;
let y = margin.top;

function startNewPage() {
  doc.addPage();
  y = margin.top;
}

function drawParagraph(text) {
  const lines = doc.splitTextToSize(text, contentWidth);
  const blockHeight = lines.length * lineHeight;

  if (y + blockHeight > usableBottom) {
    startNewPage();
  }

  doc.text(lines, margin.left, y);
  y += blockHeight;
}

drawParagraph('This paragraph is wrapped to the available content width.');
doc.save('report.pdf');

This is a minimal measured-flow pattern, not a universal typesetting engine. Set lineHeight to match the font size and line spacing you use. If you change font, size, spacing, or text width, recalculate the layout using those actual settings. The y coordinate for doc.text() is the text baseline, so tune the height increment to your document’s chosen typography rather than assuming the example’s 5 mm fits every style.

Measure wrapped text before drawing

Use doc.splitTextToSize(text, availableWidth) to get the lines at the width you will actually draw. Then calculate the block’s height from the returned line count and the line-height setting. A character-count estimate is unreliable because line wrapping depends on font metrics, font size, and available width.

The simple function above moves an entire paragraph if it does not fit in the remaining space. That avoids splitting a paragraph at an arbitrary line, but it can leave unused room at the bottom. If a paragraph is taller than the printable height of a page, moving it repeatedly will never make it fit. Such content needs to be divided into chunks that fit across pages, with the cursor advanced as each chunk is drawn. Apply the same principle to any large block: make progress by consuming content, not by repeatedly adding empty pages.

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

What to recalculate when layout changes

  • Available width: page width minus left and right margins.
  • Wrapped lines: measure with the same width and font settings used for output.
  • Block height: line count multiplied by the document’s actual line spacing, plus any intentional spacing before or after the block.
  • Boundary: compare the next block’s ending y with page height minus the bottom margin.

Paginate tables with jsPDF-AutoTable

For structured tabular data, AutoTable is generally more suitable than manually positioning every cell. It can wrap cell content and paginate rows. Give it explicit margins that match your document’s layout, and read its final printed y position before placing anything after the table.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
doc.autoTable({
  startY: y,
  margin: {
    top: margin.top,
    right: margin.right,
    bottom: margin.bottom,
    left: margin.left
  },
  pageBreak: 'auto',
  rowPageBreak: 'avoid',
  showHead: 'everyPage',
  head: [['Item', 'Description']],
  body: [
    ['A', 'A short description'],
    ['B', 'A longer description that may wrap within the cell']
  ]
});

y = doc.lastAutoTable.finalY + 8;
// Draw following content using y as its starting position.

The documented options offer different control over page and row behavior:

Option Values Use
pageBreak 'auto', 'avoid', 'always' Controls whether the table starts or continues on a new page according to the selected behavior.
rowPageBreak 'auto', 'avoid' 'avoid' asks the plugin to keep a row together where possible.
showHead 'everyPage', 'firstPage', 'never' Controls whether the table header is shown on each page, only its first page, or not at all.

rowPageBreak: 'avoid' is not a guarantee that every row will fit intact: an exceptionally tall row can exceed a page. Consider shortening, splitting, or restructuring that row if it cannot fit in the available space. Use doc.lastAutoTable.finalY as the handoff point for content after the table; guessing from the table’s row count or starting y can place later content over the table or too close to the page edge.

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.

Manual layout or AutoTable?

Need Manual measured flow AutoTable
Exact placement of bespoke mixed content Direct control over y positions and block order. Less suited to arbitrary page composition outside the table.
Wrapping and row pagination You must measure, split, and place content yourself. Handles table-cell wrapping and table pagination.
Repeated table headers You must draw them on each relevant page. Configure with showHead, including 'everyPage'.
Exceptionally tall content Must be split into page-sized chunks deliberately. A row may still exceed a page even with rowPageBreak: 'avoid'.
Version-specific pagination risk Depends on your own layout logic. Verify generated output, especially when horizontal page breaks are enabled.

Headers, footers, and page transitions

Resetting y to the top margin is necessary after every addPage(); otherwise the new page inherits a cursor near the old page’s bottom and content can still be misplaced. If your document uses a header or footer, draw it again for each page where it belongs. Keep footer space inside the reserved bottom margin so body content does not collide with it.

Custom AutoTable hooks can also affect layout. Its cursor state is mutable, so inspect hooks that change data.cursor or add page headers and footers. A hook that changes the cursor unexpectedly can invalidate assumptions about where a row or following content will appear.

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

Check for missing rows with horizontal page breaks

Horizontal table pagination is a version-sensitive area. A report opened May 8, 2026, lists jspdf-autotable 5.0.2 and jspdf 3.0.0 and describes rows being silently skipped when horizontalPageBreak: true is combined with horizontalPageBreakBehaviour: 'immediately'. The report attributes the behavior to a path that skips a row that does not fit the remaining page space instead of deferring it. This is a reported issue for that described configuration, not proof that every AutoTable table or version loses rows.

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

If your table uses horizontal page breaks, reproduce the output using the exact dependency versions in your project. Open the resulting PDF and compare the rendered rows with the input data. Do not assume that a successful PDF save means every record made it into the file.

Debug bottom clipping step by step

  1. Log the geometry: record the jsPDF unit, page width and height, all margins, current y, measured line count, and calculated block height.
  2. Check the boundary: before drawing, verify y + blockHeight <= pageHeight - bottomMargin. Include any spacing that belongs to the block.
  3. Measure at the real width: call splitTextToSize with the available width and the font settings used for the actual text.
  4. Inspect every page transition: after addPage(), reset y and redraw any required header or footer.
  5. Hand off after tables correctly: read doc.lastAutoTable.finalY before drawing the next block.
  6. Audit hooks: check AutoTable callbacks for cursor mutations or page decorations that alter layout.
  7. Verify the file visually and against the data: inspect the final line and row, plus headers and footers on every page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common causes and fixes

  • The last line is clipped: the estimated text height or bottom boundary is wrong. Measure wrapped lines at the actual width and check their full height before drawing.
  • Content on a new page starts too low: the cursor was not reset. Set y back to the top margin immediately after addPage().
  • A table is followed by overlapping text: the next block uses a guessed endpoint. Start it from doc.lastAutoTable.finalY plus the desired gap.
  • A whole paragraph is pushed forward or leaves a large blank area: the example’s all-or-nothing policy moves the block as a unit. Split long content into chunks if page-space utilization matters.
  • A very tall table row still breaks awkwardly: rowPageBreak: 'avoid' only asks AutoTable to keep a row together where possible. Restructure content that cannot fit on one page.
  • Rows are absent from a horizontally paginated table: check your exact jsPDF and AutoTable versions and horizontal-break settings, then compare output rows with source data.

Or skip the browser setup

If the job is to capture a live webpage as an image or PDF—not to paginate a PDF your application is building with jsPDF—you can use ScreenshotNeo, a website screenshot API and MCP server. Its one-call API returns a PNG, JPEG, WebP, or PDF; it does not replace jsPDF’s layout logic for generated reports.

For example, this cURL request captures a webpage as WebP:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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
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 request options. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Frequently Asked Questions

Does adding a larger bottom margin by itself stop clipping?

No. The layout code must use that margin as its boundary when deciding whether to draw or move content.

Why does a PDF save successfully even when a table row is missing?

Saving confirms a file was produced, not that every input row was rendered. Compare output with source data, especially when using horizontal page-break options.

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.