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

Use Paged.js in Nuxt only after the browser has rendered the content you want to paginate. Nuxt can render application code on the server, where browser globals such as window and document do not exist. For an in-app print preview, load Paged.js on the client and call its Previewer after the source content is mounted. For scripted PDF creation, treat pagedjs-cli as a separate headless-browser workflow rather than as part of the interactive preview.

Choose the Paged.js mode that matches the job

Paged.js is a free, open-source JavaScript library for turning HTML into paginated, print-style output. It is a browser pagination engine, not a data paginator: it lays out content across pages rather than splitting a dataset into application-level records. The project documentation describes three distinct ways to use it: a configurable npm-module Previewer, an automatic polyfill for a whole document, and a command-line tool for PDF generation. See Paged.js documentation.

Mode Use it when Trade-off
npm Previewer A Nuxt interface should paginate selected content into a particular output element. Offers control over content, styles and destination, but must run after browser rendering.
paged.polyfill.js A standalone document should automatically become a paginated preview. It processes and replaces the whole page body, which can conflict with a Nuxt application shell.
pagedjs-cli A script or automation workflow should create PDFs in a headless browser. It is a separate generation route, not an interactive preview in the user’s Nuxt session.

For most Nuxt applications that need an on-screen preview of one article, report or invoice, start with Previewer. Reach for the polyfill when the page itself is the print document, and for the CLI when a process needs to generate a PDF without a user opening the preview.

Why Paged.js belongs on the client

Nuxt’s universal rendering model means application code can run in Node during server-side rendering and later in the browser. Vue’s SSR guidance explains that browser-specific APIs, including window and document, are unavailable in Node; accessing them during server evaluation can throw. See Vue’s Server-Side Rendering guide and Nuxt’s Rendering Modes.

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

Pagination also needs the actual rendered source and its styles. Call Paged.js only after the relevant DOM exists, and after content changes, run pagination again for the updated content. Do not assume a server render produces the paginated browser preview. Avoid a top-level import if the installed Paged.js version evaluates browser-dependent code during module loading; a dynamic import inside the client lifecycle hook is a conservative boundary.

Build a client-side preview in a Nuxt component

The example below separates the source content from the destination where Paged.js renders its pages. The import is deferred until onMounted, so it is not evaluated as part of the server render. The exact module export and method signature should be checked against the Paged.js version installed in your project; the documentation describes the Previewer API and its content, stylesheet and destination inputs, but does not establish one Nuxt-major-specific integration recipe. The pattern deliberately avoids prescribing a Nuxt plugin filename or universal directive.

<template>
  <ClientOnly>
    <section>
      <div ref="source" class="print-source">
        <h1>Quarterly report</h1>
        <p>This is the HTML that will be paginated.</p>
      </div>
      <div ref="pages" class="paged-output" aria-live="polite"></div>
    </section>
  </ClientOnly>
</template>

<script setup>
import { onMounted, ref } from 'vue'

const source = ref(null)
const pages = ref(null)

onMounted(async () => {
  if (!source.value || !pages.value) return

  const { Previewer } = await import('pagedjs')
  const previewer = new Previewer()
  const flow = await previewer.preview(
    source.value.innerHTML,
    [],
    pages.value
  )

  console.log('Paginated pages:', flow.total)
})
</script>

<style>
.paged-output .pagedjs_page {
  margin: 1rem auto;
  box-shadow: 0 1px 8px rgb(0 0 0 / 15%);
}
</style>

This example assumes your installed package exposes a named Previewer export and supports the shown preview(content, styles, destination) call. Confirm those details against your exact package version and its JSDoc before shipping; imports and API signatures can vary by version. The returned flow object contains page information, and this example logs its total value as a useful integration check. The Paged.js API reference is at Paged.js JSDoc.

Keep source and output separate

Place the unpaginated markup in a source element and render pages into a distinct destination. This keeps the original content available for subsequent renders and avoids confusing the Nuxt application shell with the document to paginate. Passing innerHTML sends the source markup; if the content includes user-provided HTML, apply your application’s normal sanitization and trust rules before rendering it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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⁴

Provide the styles Paged.js should use

The second argument in the example is an empty stylesheet list. Supply the document’s print CSS there when your setup expects stylesheet inputs, or ensure the styles are otherwise available to the pagination context. Define page dimensions and breaks using print-oriented CSS, and make sure linked stylesheets, fonts and images have loaded before pagination. Paged.js’ getting-started material says its browser script starts after page resources, including images and fonts, load; an early manual call in a component should not be assumed to inherit that timing automatically. See Getting Started with Paged.js.

Rerun when content changes

The example runs once when the component mounts. If your page content is asynchronous or reactive, wait until data has populated the source, then invoke the preview. When a user changes the document, clear or replace the old output before creating the new pagination flow so stale pages are not mistaken for the current version. Debounce rapid edits if each edit would otherwise trigger a full layout pass. These are application lifecycle choices; the Paged.js documentation does not establish a Nuxt-specific reactive integration.

When to use the automatic polyfill

The polyfill is designed to process a page automatically into paginated output. That can be convenient for a standalone HTML document whose body is the print document. In a Nuxt app, however, the body usually also contains navigation, controls and other application UI. Because the documented behavior replaces the body with its paginated rendering, applying the polyfill to the whole Nuxt page can remove or disrupt the app shell. Use it only when the entire document is intended to become the paginated output, not as a shortcut for targeting one component.

Generate PDFs with the CLI as a separate workflow

For automated output, Paged.js documents a CLI route using pagedjs-cli and pagedjs with a headless browser to generate a PDF. This is a different architecture from showing a preview in a user’s Nuxt page: a command-line job consumes an HTML document and writes a file, while the component approach renders pages in the browser UI. The Paged.js JSDoc documents the CLI/project route at Paged.js JSDoc.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Whether that command belongs in a build step, a separate worker or an on-demand job depends on how your Nuxt application is deployed and when the source HTML is available. The documentation does not establish one deployment pattern for every Nuxt project. Verify the installed CLI version and the availability of its headless-browser dependencies in the environment that will run it. Do not assume a client-side preview automatically supplies the server-side CLI with the same content, fonts, credentials or network access.

Common Nuxt and Paged.js problems

Symptom Likely cause What to do
window is not defined or document is not defined Browser-dependent code ran during SSR or module evaluation. Move the import and Paged.js call into a browser lifecycle step such as onMounted; check whether your installed package is safe to import at module scope.
The preview target is empty or pages are missing The call ran before content or the destination element existed, or asynchronous data had not loaded. Check both refs, wait until the source is populated, and then invoke the preview.
The Nuxt interface disappears or is replaced The whole-page polyfill was applied to an application shell. Use Previewer with a dedicated output element for selected content, or reserve the polyfill for a standalone document.
Page breaks or visual layout look wrong Print styles, page dimensions, or resource timing do not match the source document. Review print CSS and page-break rules, provide the intended styles to the preview, and wait for linked resources such as fonts and images before paginating.
The preview shows old text after an edit The preview ran only on mount, while the source changed later. Trigger a new preview after the content update and replace the old output.
The import or Previewer call fails The code’s export shape or signature does not match the installed Paged.js version. Inspect the installed package and its version-specific JSDoc; do not treat a conceptual Nuxt pattern as a version-independent plugin recipe.
The CLI works locally but not in deployment The deployed job may lack a compatible CLI version, headless-browser dependencies, or access to the source resources. Verify the CLI and runtime in the target environment, then decide whether PDF work should run in a build, worker or on-demand process.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and cost considerations

The cited Paged.js documentation establishes the browser, Previewer and CLI modes, but does not provide a suitable general performance figure or adoption statistic. Treat pagination time as dependent on your document, assets, styles, browser and runtime rather than promising a fixed duration. Large documents and resource-heavy pages are especially worth measuring in the environment your readers will use.

For an in-browser preview, minimize unnecessary reruns: wait for content, paginate after meaningful updates, and avoid launching a new layout operation for every keystroke. For generated PDFs, test the complete headless workflow with the same document assets and deployment permissions used in production. Paged.js is described as free and open source; no paid service is required by the cited integration routes. That does not remove the operational costs of the browser or compute environment you choose for PDF jobs.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not a substitute for Paged.js pagination or PDF layout. If your task is to capture a rendered web page as an image or PDF instead of building a paginated Nuxt preview, one GET request can return a screenshot. The service removes cookie banners, newsletter popups and chat widgets before capture; bot checks, blank pages and failed loads are not billed. Its MCP server lets AI agents use screenshot tools, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. See ScreenshotNeo.

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 API documentation for the request options. Sign up for 1,000 free screenshots a month, with no card required.

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

Frequently Asked Questions

Does Paged.js paginate Nuxt data or HTML layout?

It paginates HTML into print-style pages; it is not a data paginator that divides records for application logic.

Can I use Paged.js for a PDF without showing an in-app preview?

Yes. The documented CLI workflow uses a headless browser to generate a PDF from an HTML document.

Is ScreenshotNeo a replacement for Paged.js?

No. ScreenshotNeo captures a web page as an image or PDF; it does not replace Paged.js pagination for a print-style preview.

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

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.