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.

To let a visitor print the page they are viewing, call window.print() after the page is ready and use print CSS to control the paper layout. To create a PDF or image without a person opening a print dialog, use a headless browser such as Puppeteer or Playwright—or send the URL to a hosted capture API. A PDF is paginated for paper; a screenshot captures pixels. Choose based on which output you actually need.

Choose print, PDF, or screenshot first

“Print a webpage” can mean three different jobs. A browser print dialog lets a person choose a printer or save destination. A generated PDF is a paginated document suitable for sharing or archiving. A screenshot is an image of the rendered page at a particular size or full-page height. These outputs are not interchangeable: print and PDF use paper-layout rules, while screenshots preserve the screen appearance.

Approach Best for What you control Main trade-off
window.print() A visitor choosing a printer or PDF destination Browser print dialog and print CSS Requires a person and browser UI
Print CSS Readable paper or PDF layout Visibility, page size, margins and page breaks Needs testing against the page’s content and layout
Puppeteer page.pdf() Unattended server-side PDF generation Browser session, print media and PDF options You operate the browser runtime
Puppeteer or Playwright screenshot Image capture of a page’s appearance Viewport, full-page capture and styles Produces pixels, not a paginated paper document
ScreenshotNeo hosted capture Teams that do not want to run a browser worker Capture settings through an API or MCP tools Uses a hosted service and its plans and terms

For the JavaScript print flow below, the user stays in control. For an unattended task, decide whether you need a PDF or an image before choosing a browser library or service.

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

Print the current page with JavaScript

The simplest way to open the browser’s print interface is window.print(). The call prints the current document; if the document is still loading, the browser finishes loading it first. The method blocks while the print dialog remains open, so do not treat it as a background export or expect code after the call to run while the dialog is active.

#1 Best Overall
Sale
Canon PIXMA TR160 Color Wireless Portable Printer
  • LIGHTWEIGHT AND PORTABLE - Connect and print on the go with the PIXMA TR160. This lightweight portable printer can fit into a bag or backpack with room to spare.
  • HIGH-QUALITY PRINTING ON THE GO - Print documents and photos up to 8.5” x 11” that showcase sharp black text and vibrant details with rich color thanks to a 5-Color Hybrid Ink System, including square and borderless prints.
  • SIMPLE & EASY CONNECTIVITY - Printing is only an app away when using the Canon PRINT app, Apple AirPrint4, or Mopria Print Service5 with your compatible device(s) or the cloud.
  • WIRELESS DIRECT MODE - Connect your compatible device to the printer even without a wireless router.
  • 1.44” OLED DISPLAY - Easily check ink levels, printer status, and other settings with the 1.44” Monochrome OLED.
<button type="button" id="print-page">Print this page</button>

<script>
  document.querySelector('#print-page').addEventListener('click', () => {
    window.print();
  });
</script>

This is a user-initiated flow: the browser displays its own print dialog, where the person selects a printer or an available PDF destination. A website cannot silently choose a person’s printer or bypass the browser’s dialog through window.print().

Wait for JavaScript-rendered content

Waiting for the initial document load is not necessarily the same as waiting for your application to finish rendering. If the page fetches data, mounts components, or loads images after that point, invoke printing only when the content the user expects is present. For a page-specific readiness signal, you can await a promise that your application resolves after rendering, or use a visible element as a simple check:

async function printWhenReady() {
  await new Promise((resolve) => {
    if (document.querySelector('[data-print-ready="true"]')) {
      resolve();
      return;
    }

    const observer = new MutationObserver(() => {
      if (document.querySelector('[data-print-ready="true"]')) {
        observer.disconnect();
        resolve();
      }
    });

    observer.observe(document.documentElement, {
      childList: true,
      subtree: true,
      attributes: true
    });
  });

  window.print();
}

Set data-print-ready="true" on an element only when the relevant page content is available. In production, also consider how your app handles an error or a readiness marker that never appears; a bounded timeout can prevent an indefinitely waiting print action.

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.

Make the page readable on paper with print CSS

Use print-specific styles to remove controls and rearrange content for paper instead of relying on the browser to guess what matters. A separate stylesheet can use media="print"; an @media print block keeps screen and print rules together. The @page rule controls page dimensions, orientation, and margins.

Rank #2
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
@media print {
  nav,
  header,
  footer,
  .screen-only,
  button {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  main {
    width: auto;
    margin: 0;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }
}

@page {
  size: A4;
  margin: 16mm;
}

Replace the example selectors with your own. Hiding a site header can reclaim page space, but do not hide information needed to understand the printed content. Keep screen-only and print-only elements explicit with classes so a CSS change does not accidentally remove important material. Long tables, cards, and images also need deliberate page-break behavior; test the actual output for clipped content and awkward splits.

If you need a temporary interface change around printing, browsers expose beforeprint and afterprint events. Use them sparingly: critical print layout belongs in CSS, and a dialog may remain open for an unpredictable time.

window.addEventListener('beforeprint', () => {
  document.body.classList.add('printing');
});

window.addEventListener('afterprint', () => {
  document.body.classList.remove('printing');
});

Generate a PDF or screenshot without a print dialog

For unattended output, a headless browser loads the page and produces a file. Puppeteer’s page.pdf() uses the print CSS media type by default. If you want the page’s screen styles in the PDF, call page.emulateMediaType('screen') first. Exact background colors may require -webkit-print-color-adjust in CSS. Puppeteer’s page.screenshot() is for raster output instead.

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

Puppeteer PDF example

Install Puppeteer in a Node.js project, then run this as an ES module. The networkidle0 wait condition is one option for sites whose requests settle; it is not a guarantee that application-specific content is ready, so use a selector or application signal when needed.

Rank #3
Sale
ETIKEZ D90E Inkless Portable Thermal Printer with Case – 8.5" x 11", Black
  • Portable Wireless Printer - The ETIKEZ D90E is an inkless printer and portable printer that uses advanced thermal technology, requiring no ink, toner, or ribbons, delivering cost-effective prints. Weighs only 2.08lb, the portable printer is incredibly lightweight and compact. Perfect for on-the-go printing during business travels, work, or university, it easily fits into backpacks or briefcases. Ideal for emergency scenarios, contracts, office documents, and more. only prints black and white
  • Bluetooth & USB Connectivity - Connect this D90E portable printer to iPhones or Android via Bluetooth. This wireless printer also works with PC over USB. As a thermal printer, it requires the Labelnize app for mobile printing; for PC, install drivers from Labelnize.com or the USB drive. This small portable printeris not compatible with Chromebooks. (Note: For laptop and computer use, connect via USB after downloading the driver from Labelnize.com.)
  • Multiple Printing and Format – The wireless portable printer supports 8.5" x 11" US Letter thermal paper (B0GD61HPDC, B0GD5JFC2Q). It meets all your various printing requirements, whether you're on the go or in a car. (Note: This thermal printer is compatible exclusively with A4 thermal paper and does not accept ordinary copy paper)
  • Gift-Ready - This portable printer, a gift for pros & students, works as a thermal printer for classroom, classroom printer for teachers, printer for college student, small classroom printer, printer for dorm room, thermal printer for teachers, and portable printer for classroom. It combines thermal & inkless, ideal for notaries, truckers, teachers, parents. Package: D90E Printer, USB-C Cable, 10-sheet Paper, Travel Case, Guide. (Charging adapter not included.)
  • How to solve paper jams: 1) Click once to pop up the paper - If the machine gets a paper jam, simply press the power button and the machine will automatically eject the paper. 2) Do not forcefully open the machine cover as it may cause injury or scratches . 3) Choose our flat thermal paper to avoid curling of the paper after printing. Note: Cannot use regular paper for printing
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.setViewport({ width: 1280, height: 900 });
  await page.goto('https://example.com', { waitUntil: 'networkidle0' });
  await page.pdf({
    path: 'page.pdf',
    format: 'A4',
    printBackground: true
  });
} finally {
  await browser.close();
}

For a screen-styled PDF, add await page.emulateMediaType('screen'); before page.pdf(). For printed colors, a stylesheet can set -webkit-print-color-adjust: exact;, but check the result in your target browser and PDF workflow rather than assuming every color will reproduce identically.

Puppeteer image example

To save a full-page PNG instead of a paginated PDF, use the screenshot API:

await page.screenshot({ path: 'page.png', fullPage: true });

A full-page image can be very tall. If you need a particular viewport, omit fullPage or set it to false, and configure the viewport before navigation or capture.

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

Playwright alternative

Playwright has the same broad distinction: page.pdf() for print-media PDF output and page.screenshot() for images. It can also apply a stylesheet during a screenshot, useful for consistently hiding changing interface elements:

Rank #4
Rongta Thermal Portable Printers Wireless for Travel, Bluetooth Mobile Printer, Inkless Printer for School/Office/Home Use, Compatible with Android,iOS & Laptop(Black)
  • Easy to Set Up: RONGTA F11A portable thermal printer for travel go by bluetooth.Download "RONGTA" APP from Google Play or APP store for iOS and Android Phone or tablet.Connect the printer via bluetooth in the App, choose the F11A and make a Bluetooth connection in the APP, then it can easily print from your iPhone, iPad, or Android mobile, tablet.The inkless portable printer supports USB cable connection for Laptops,compatible with Windows 7-11 and MacOs for PC.
  • RONGTA portable printer, 203DPI resolution, large to 8.5" design, easy to use and maintain. Print forms, letters, assignments, study materials, and travel documents hassle-free with advanced thermal technology. Ideal for printing outdoor, meeting office, or at home.
  • Stylish Thermal Printer:Rongta bluetooth wireless printer, It is compatible with your go-to paper sizes—including US Letter, Legal, A4 thermal papers. What’s more, it requires no ribbons or ink cartridges at all. Designed for hassle-free home and travel use, it combines portability, versatility, and ultra-low operating costs in one sleek device.
  • Portable and Compact: When traveling you can take Rongta portable printer wireless in your backpack or tote bag wherever you need. It is compact and portable whether in office home or on business trips,or any outdoor occations. Print contracts,office documents,inventory lists,or study materials for school.
  • Warm Tips: Do Not Support Chrome. Rongta portable printers wireless for travel can't support pair bluetooth via Phone or tablet directly, must be pair on the"RONGTA" APP. Download APP, then turn on app make a Bluetooth connection. Please use thermal paper, do not support normal paper.
import { chromium } from 'playwright';

const browser = await chromium.launch();
try {
  const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.screenshot({
    path: 'page.png',
    fullPage: true,
    style: 'nav, .chat-widget { display: none !important; }'
  });
} finally {
  await browser.close();
}

Use the browser automation option that fits your existing deployment and browser requirements. In either library, set the viewport, wait for fonts and application content where necessary, and decide whether screen or print media rules should apply before relying on repeated captures.

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 is a hosted website screenshot API and MCP server for developers. Its one-call endpoint returns a screenshot or PDF. The following cURL example saves a WebP screenshot; the ScreenshotNeo API documentation explains the available request options, including PDF output.

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

Equivalent Python and Node.js requests:

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}`);

Use your API key in place of YOUR_API_KEY and change the target URL as needed. The sample saves the response bytes; for production use, check the response status and headers before treating the body as a successful image. The service’s response includes X-Page-Verdict and X-Billed headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Before capture, it accepts the cookie or consent banner 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 or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing. The response identifies page verdict and billing status in the headers.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents, including Claude, Cursor, and other MCP clients.
  • The service also supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets and custom viewports, retina scale, PDF settings, HTML/CSS input, custom CSS and JavaScript, clicking or waiting for elements, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, image resizing, configurable cache TTL, signed public image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work to ease migration.

Pricing is monthly: Free includes 1,000 shots with no card; Starter is $5 for 3,000; Growth is $15 for 15,000; Pro is $39 for 60,000; Scale is $99 for 250,000; and Business is $249 for 1,000,000. Yearly billing gives two months free. Every feature is available on every plan.

Best Value
Sale
Gloryang Inkless Portable Printer for Travel, Wireless Thermal Printer Supports 8.5 x 11 Inch Thermal Paper, Bluetooth Machine Includes Carry Case and 3 Rolls of Paper Kit, Black
  • Inkless Printing – Gloryang portable printer uses advanced thermal technology, requiring no ink, toner, or ribbons. The package includes the printer, 3 thermal paper rolls (1 pre-installed + 2 extras), a carrying case, charging cable, manual, and guide card. Cost-effective and easy to use. Note: Only compatible with Gloryang thermal paper; not for regular, inkjet, or plain paper.
  • Seamless Bluetooth Connectivity – The Gloryang mobile sticker printer connects easily to iOS and Android via Bluetooth through the “Jadens Printer” app. It also works as a compact printer for laptops and computers—simply turn on the printer first, then install the driver to set up. Print anytime, anywhere.
  • Ultra-Portable Design - Weighing just 1.75lb and measuring 1.7in thick, the Gloryang portable printer is incredibly lightweight and compact. Perfect for on-the-go printing during travels, work, or university, it easily fits into backpacks or briefcases. Ideal for emergency scenarios, contracts, office documents, and more.
  • Space-Saving Design - Say goodbye to clutter with the built-in paper bin of the Gloryang printer. It saves space and keeps your workspace tidy, whether you're on the go or in a car. With two ways to load thermal paper and the ability to print documents ranging from 2 to 8.5 inches, it caters to various printing needs.
  • Perfect Gift for Holiday-Gloryang thermal printer can print clear photos, image, design drawings and text. It's perfect for busy professionals and students. Come with a nice case, making it as a perfect Christmas and new year gift for your families and friends.

Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; an MCP server lets AI agents take screenshots; and 1,000 screenshots a month are free with no card, with paid plans starting at $5 for 3,000. Sign up for ScreenshotNeo and start with the free plan.

Troubleshoot incomplete or unexpected output

  • The printed page is missing dynamic content. The print call or capture ran before the app completed its render. Wait for an application-specific selector or readiness signal, not just the initial navigation event.
  • Navigation or buttons appear on paper. Add their actual selectors to an @media print rule. Check that the print stylesheet is loading and that another rule is not overriding it.
  • Content is clipped or split badly. Inspect the PDF or print preview, adjust @page margins, and add page-break rules around elements that should remain together. A layout that fits the browser viewport may not fit a paper page.
  • Colors or backgrounds differ in the PDF. Print media may suppress backgrounds or use print-specific colors. Enable background printing where the browser supports it and consider -webkit-print-color-adjust; verify the resulting file.
  • The headless job waits indefinitely or times out. Some pages keep network requests open, while others declare network idle before their app content is ready. Choose a wait strategy for the site, then wait for the specific content required and set a finite timeout.
  • The screenshot is unexpectedly short. A viewport screenshot captures the visible area only. Enable full-page capture for a long page, or capture a specific element when only one section is needed.
  • The API response is not the expected image. Check the HTTP status and the X-Page-Verdict and X-Billed headers. A bot check, blank page, timeout, or failed load is a different outcome from a successful capture; inspect the target’s access requirements and your requested settings.

Performance, repeatability, and cost

Printing locally has no hosted capture request, but the user must operate the browser UI. Running Puppeteer or Playwright in a server job gives you control over the rendering session and output settings, while also making your application responsible for browser installation, execution, and cleanup. Close browser instances in a finally block as in the examples, and avoid reusing a page state when cookies or other session data could contaminate a later job.

For repeatable captures, set viewport and media type deliberately, wait for fonts and page-specific content, and decide how remote images and other assets should load. Network-idle waits are useful but not universally reliable. A hosted API avoids operating a local browser worker, but your workflow then depends on the service’s request options and plan. ScreenshotNeo offers a usage API and cache TTL setting; successful cache hits are not billed, according to its stated billing behavior. No comparative speed or reliability benchmark is implied here.

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

If each job needs a paginated document, request a PDF and test page breaks. If it needs an image, use screenshot capture and select viewport or full-page behavior. Keeping that distinction clear prevents a common mismatch: a visually faithful screenshot cannot substitute for document pagination, and a PDF is not simply an image with a different extension.

Frequently Asked Questions

Can I use a hosted capture API from a serverless function?

The API is called with an HTTP GET request, so it can fit a serverless workflow that is allowed to make outbound requests. Check your platform’s execution timeout and networking limits against your job; those platform-specific limits are not specified here.

Does a hosted screenshot API mean the target website is never opened in a browser?

No. The service handles the browser rendering for you; the difference is that you do not install and operate the browser runtime in your own application.

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.

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