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

Render the complete export dataset, wait for your application and its assets to finish, then generate the PDF through a browser print pipeline. A print command only knows about records present in the rendered document; it will not automatically retrieve pages hidden behind client- or server-side pagination. Build a print-specific view, apply paged-media CSS, configure page options, and inspect the resulting file with short, long, and boundary-case data.

Decide what “export” means before writing code

Interactive pagination and PDF pagination solve different problems. Your table may show 25 rows at a time while the export is expected to contain one of three scopes:

  • Current page: exactly the rows visible in the UI.
  • Selected records: only rows the user checked.
  • Entire result: every record matching the report filters, including rows on server-side pages the browser has not loaded.

Make this scope explicit in the export button label and request. For an entire-result export, create a dedicated data endpoint or export query. Do not call window.print() and assume unseen server pages will appear; the renderer can print only DOM content that exists when capture starts.

Build a complete export view

Use a print representation, not the virtualized screen

Virtualized grids often keep only visible rows in the DOM. For PDF generation, render all intended rows in a normal table or a print-only component. Keep the interactive grid and export view separate if displaying thousands of rows would make the application slow.

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

Fetch and mark data readiness

Wait for the export query, chart drawing, images, and fonts. A navigation-success event does not mean that framework effects, client fetches, or canvas rendering have completed. Set an application flag after the last required operation:

async function prepareExport(filters) {
  const rows = await fetch('/reports/export?' + new URLSearchParams(filters))
    .then(response => {
      if (!response.ok) throw new Error(`Export request failed: ${response.status}`);
      return response.json();
    });

  renderRows(document.querySelector('#export-table tbody'), rows);
  await renderCharts(rows);                 // resolve after charts are painted
  await document.fonts.ready;
  await Promise.all([...document.images].map(image =>
    image.complete ? Promise.resolve() : new Promise(resolve => {
      image.addEventListener('load', resolve, { once: true });
      image.addEventListener('error', resolve, { once: true });
    })
  ));
  document.documentElement.dataset.exportReady = 'true';
}

Use a failure state as well as a success state. If a required request fails, show the error instead of producing a plausible-looking PDF with missing rows.

Control page size and breaks with print CSS

CSS paged media defines the sheet, printable area, margins, and fragmentation behavior. Put screen-only controls outside the export root or hide them in @media print.

@page {
  size: A4 portrait;
  margin: 16mm 12mm 18mm;
}

@media print {
  .screen-only, .pagination-controls, .loading-indicator {
    display: none !important;
  }

  body {
    margin: 0;
    color: #111;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-header {
    break-after: avoid;
  }

  .report-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr, img, figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .new-page {
    break-before: page;
    page-break-before: always;
  }
}

#export-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#export-table th, #export-table td {
  padding: 4pt 5pt;
  border: 0.4pt solid #999;
  overflow-wrap: anywhere;
  vertical-align: top;
}

break-inside: avoid is a request, not an absolute guarantee. A row taller than a page must be split or overflow, and browser implementations differ. Avoid placing an unbounded paragraph or image inside an element you require to stay together.

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

Repeat table headings

Using thead { display: table-header-group; } lets print engines repeat headings when a table spans pages. Confirm the behavior in the browser engine used in production; do not rely on what a different desktop browser preview shows.

Handle wide tables deliberately

Choose landscape orientation for genuinely wide reports, reduce columns, or create a separate detail section. Shrinking a 15-column table until text is unreadable is not a pagination solution. Long unbroken IDs need overflow-wrap: anywhere; otherwise they can force overflow beyond the printable area.

Generate the PDF with a headless browser

Browser print-to-PDF is the closest match when your HTML and print CSS are the source of truth. Configure paper format, orientation, margins, backgrounds, and header/footer behavior in the renderer. A representative Playwright implementation is:

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⁴
import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({
  viewport: { width: 1440, height: 900 },
  deviceScaleFactor: 1
});

try {
  await page.goto('https://app.example.com/reports/export?id=42', {
    waitUntil: 'domcontentloaded'
  });

  await page.waitForFunction(() =>
    document.documentElement.dataset.exportReady === 'true'
  );
  await page.emulateMedia({ media: 'print' });

  await page.pdf({
    path: 'report-42.pdf',
    format: 'A4',
    landscape: false,
    printBackground: true,
    margin: { top: '16mm', right: '12mm', bottom: '18mm', left: '12mm' },
    displayHeaderFooter: true,
    headerTemplate: '<span></span>',
    footerTemplate: '<div style="font-size:9px;width:100%;text-align:center">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>'
  });
} finally {
  await browser.close();
}

Use the equivalent controls in your chosen browser automation library. Keep header and footer templates free of external assets unless your renderer explicitly supports them. If you need CSS backgrounds, enable background printing; otherwise colored bands and chart fills may disappear.

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

Wait for the conditions your renderer cannot infer

Managed browser APIs commonly expose separate switches for images and fonts, and those switches may default to false. Enable them where available, then add application-specific waits for data and charts. A reliable readiness checklist is:

  • The export query returned the expected record count.
  • The DOM contains the final row, not a loading skeleton.
  • Fonts report ready, or a deliberate fallback font is acceptable.
  • Images have loaded or failed with an intentional placeholder.
  • Charts have completed drawing and are not still animating.
  • Any “load more” operation has finished.

Prefer a deterministic selector or readiness flag to a fixed sleep. A delay can be too short on a busy server and unnecessarily long on a fast one. If a third-party widget never settles, hide it from the export or replace it with static data.

When to add explicit pagination with Paged.js

Browser fragmentation is sufficient for many reports. Add Paged.js when users need a paginated preview before downloading, named page regions, or a scriptable composition layer. Paged.js is a free, open-source HTML paginator that fragments content in the browser and can be driven from a headless browser.

Keep the responsibilities separate: your application still supplies the complete data and waits for assets; Paged.js determines page boxes and breaks; the browser produces the final PDF. Validate the preview and PDF together because paged-media features and browser implementations are not identical.

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

When a direct HTML-to-PDF engine is appropriate

A direct converter can be a good fit for a controlled template or server-side pipeline, but its CSS is not automatically equivalent to a browser. For example, tc-lib-pdf documents page flow and repeated table headers while not implementing flexbox or grid. Rewrite the export template using the engine’s supported subset, or select another renderer. Test the installed release because support details are version-sensitive.

Approach Best fit Trade-off
Browser print-to-PDF PDF should match existing HTML and print CSS Requires explicit waits and browser-specific pagination checks
Paged.js plus browser Paginated preview or deliberate page composition Adds a pagination layer and implementation differences
Direct HTML/CSS engine Template matches that engine’s supported CSS CSS subset may exclude layout features such as flexbox or grid
Hosted browser API You want managed browser infrastructure Review privacy, deployment, operational, and commercial requirements

Validate the actual PDF

Automated success only proves a file was written. Open and inspect representative outputs, and add machine checks for page count and expected text where practical.

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.
  • One-row and empty-result reports.
  • Data ending exactly at a page boundary, plus one row beyond it.
  • Long text, long identifiers, multiline cells, and large images.
  • Wide tables in portrait and landscape.
  • Slow font and image loading, failed images, and a failed data request.
  • Short and very long datasets, including the largest supported export.

Check that the first row after every page break has the correct heading, no footer overlays content, links remain usable, and dates and time zones match the report’s stated context. Compare the displayed record count with the export query count so silent truncation is visible.

Accessibility, tagging, and metadata

Start with semantic source HTML: a caption, a logical heading hierarchy, th cells with appropriate scope, meaningful link text, and text alternatives for informative images. Some browser services can produce tagged output, but tagging depends on the accessibility of the source markup and is not, by itself, PDF/UA certification. If formal accessibility or archival metadata is required, preserve the semantic structure, enable tagging where your renderer supports it, and run a suitable PDF validator and compliance review.

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

Troubleshooting common failures

Only the visible table page appears

Cause: the export printed a client-side or server-side paginated component. Fix: call an export endpoint that returns the complete intended scope and render a print-only table.

The PDF has a loading spinner or missing chart

Cause: capture began after navigation but before application rendering finished. Fix: expose an explicit readiness flag and wait for data, chart completion, fonts, and images.

Rows split in awkward places

Cause: fragmentation rules are hints and can vary by engine. Fix: apply break-inside: avoid to rows or logical sections, shorten oversized content, and test the production browser.

Colors or logos are absent

Cause: background printing is disabled or an asset was not reachable from the rendering environment. Fix: enable background output, use absolute asset URLs or embedded assets, and wait for image completion.

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

Flexbox layout collapses in a direct converter

Cause: the selected engine does not implement that CSS feature. Fix: use tables or supported block layout for that template, or switch to a browser renderer.

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

Output is inaccessible despite “tagged PDF” being enabled

Cause: tags reflect source semantics and do not constitute certification. Fix: correct the HTML structure and validate the final PDF against the applicable accessibility requirements.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. For a PDF, use its documented capture options for paper size, margins, orientation, and page ranges.

For a quick image or PDF-oriented workflow, the API call is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 documentation for the full parameter set, including full-page loading, CSS selectors, custom JavaScript, waits, cookies, headers, caching, asynchronous jobs, and PDF settings. The same endpoint works from Python:

import requests
r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

And Node.js:

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots each month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Operational and cost considerations

  • Data volume: very large exports increase browser memory and PDF size. Consider an asynchronous job, streaming source data into a purpose-built document, or a maximum row policy.
  • Security: authenticate export URLs, restrict which hosts a renderer may visit, and avoid exposing secrets in query strings. Treat cookies and custom headers as sensitive.
  • Reliability: record the export scope, query filters, row count, renderer version, and failure reason. Retry transient navigation or asset failures, but do not retry deterministic validation errors indefinitely.
  • Reproducibility: pin browser and converter versions, fonts, locale, time zone, and CSS. A browser update can change line wrapping and page breaks.
  • Privacy: decide whether rendering occurs inside your network or through a hosted service, and document retention and access controls for generated files.

Frequently Asked Questions

Should I export from the database instead of the browser?

Use a database-driven document pipeline when the export is extremely large or must be independent of UI layout; use browser rendering when fidelity to the existing HTML and print CSS is the priority.

Can CSS guarantee that a row never splits?

No. Fragmentation properties are hints, and an element taller than a page cannot remain intact. Test the production renderer and design oversized content to wrap or continue safely.

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

Do I need Paged.js for every multi-page report?

No. Native browser print pagination is usually enough. Paged.js is useful when you need a paginated preview or more explicit page composition.

How do I prove that no records were omitted?

Persist the export query and expected count, render a count in the report metadata, and compare it with the final DOM count or a post-generation text check.

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.