October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Render a Long HTML Page as Tiled JPEG Images with Playwright

Playwright renders the page in a browser and can save a full-page JPEG. To produce separate tiles, crop the screenshot buffer or capture defined page regions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To render HTML as a JPEG, let a browser render the page, then capture it with Playwright. A full-page capture makes one tall JPEG; it does not divide the page into tiles automatically. To get separate tiles, capture defined regions or crop the full-page screenshot buffer with an image-processing library.

Render HTML to one full-page JPEG

Playwright’s page.setContent() loads an HTML string into a page. Set the viewport before capture, then call page.screenshot() with fullPage: true and type: 'jpeg'. The screenshot method returns a buffer that can be saved or passed to an image-processing step. See the Playwright Page API and screenshots guide.

As an Amazon Associate I earn from qualifying purchases.

import { chromium } from 'playwright';
import { writeFile } from 'node:fs/promises';

const html = `
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <style>
      body { font: 16px/1.5 system-ui, sans-serif; margin: 24px; }
      .section { min-height: 900px; padding: 24px; border-bottom: 1px solid #ccc; }
    </style>
  </head>
  <body>
    <main>
      <section class="section">First section</section>
      <section class="section">Second section</section>
      <section class="section">Third section</section>
    </main>
  </body>
</html>`;

const browser = await chromium.launch();
try {
  const page = await browser.newPage({ viewport: { width: 1200, height: 900 } });
  await page.setContent(html, { waitUntil: 'load' });
  const jpeg = await page.screenshot({
    type: 'jpeg',
    fullPage: true,
    quality: 80,
    scale: 'css'
  });
  await writeFile('page.jpg', jpeg);
} finally {
  await browser.close();
}

Install Playwright and its browser for the runtime you use, then run this as an ES module. The result is one JPEG representing the rendered page state—not a conversion of the HTML source code. If the content depends on external fonts, images, or scripts, make sure those resources have loaded before taking the screenshot; otherwise the captured appearance may be incomplete.

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

Choose dimensions and image quality

  • fullPage: true captures the full scrollable page into one image.
  • quality is a JPEG quality setting from 0 to 100; the documented default is 80. Lower values generally reduce file size at the cost of more compression artifacts.
  • scale: 'css' uses CSS-pixel dimensions. scale: 'device' uses device-pixel dimensions and can produce a larger image.
  • JPEG does not support transparency. Use a format that supports transparency if preserving a transparent background is required.

These options are documented in the Playwright Page API. Choose a viewport width that matches the layout you want: responsive pages may rearrange when the viewport changes.

#1 Best Overall
Sale
HP DesignJet T210 Large Format 24-inch Plotter Printer, for Easy CAD & Poster Prints (8AG32D)
  • Ideal for: Technical line drawings, renders requiring precise, accurate line-quality and crisp text, posters, maps, and professional sewing patterns.
  • Media Sizes: Up to 24-inch wide media rolls (large format), and up to 13-inch by 19-inch sheets (wide format) using the optional automatic sheet feeder accessory.
  • Media Handling: Sheet feed, roll feed, automatic horizontal cutter.
  • Simple & Cost Effective: Print multi-size projects automatically, without needing to manually switching the media source. Cost saving efficiencies like using 95% less ink for routine maintenance vs. other competitor plotter printers.
  • Simplify Printing with Included HP Click Software: Save time, ink, and paper waste with PDF error checking, alerts, and auto-nesting. Predefine your print settings and easily print files (PDF, JPEG, TIFF, DWF, HP-GL/2, PNG) by simply dragging and dropping them. HP Click Driver is integrated with your workflow. Print directly from your design and common CAD applications.

Make fixed-size JPEG tiles

A full-page screenshot is a single tall image, not a ready-made set of uniformly sized tiles. For tiles, either capture page rectangles individually or capture once and crop the returned buffer. Cropping the buffer is often simpler when tiles should exactly reproduce one full-page render; individual captures can be useful when the full image is impractical for the chosen browser or workflow. Neither approach has a universal maximum dimension or a prescribed tile algorithm in the cited browser documentation, so validate your chosen dimensions and memory use in your own environment.

Crop the full-page buffer

  1. Capture the page with fullPage: true and retain the returned buffer.
  2. Read the image’s actual pixel width and height using an image-processing library.
  3. Choose tile width and height in pixels. For vertical strips, set the tile width to the image width and divide the height into ranges.
  4. Crop each range from top to bottom. If you want overlap for downstream stitching or visual review, define that overlap explicitly and account for it when calculating each crop’s vertical origin.
  5. Name outputs by order, such as tile-000.jpg, and inspect the first, last, and boundary areas for clipping or seams.

Keep coordinate systems straight: CSS dimensions, device scale, and the encoded image’s pixel dimensions are not necessarily identical. Query the output image dimensions rather than assuming a crop coordinate based only on the viewport. A cropped JPEG may also be recompressed, so select an appropriate quality for the image-processing step.

Rank #2
Sale
Epson Workforce Pro WF-7840 Wireless All-in-One Wide-Format Inkjet Printer
  • Print, copy, scan and fax all from 1 machine with this Epson WorkForce Pro WF-7840 Wireless All-in-One Color Printer. The printer is capable of delivering wide-format prints up to 13" x 19", while the PrecisionCore Heat-Free technology helps produce printouts quickly. The DURABrite Ultra ink dries quickly to ensure smudge-free results, and the 500-sheet capacity is built to meet the demands of your office.
  • Built-in wireless (802.11a/b/g/n/ac) connection offers cable-free convenience.
  • Use Epson Connect Solutions to stay productive while on the go. Functions include Epson Email Print, Epson Remote Print, Epson Smart Panel app (iOS and Android), Epson iPrint app (iOS and Android) and Creative Print app (iOS and Android).
  • Print from almost anywhere using Apple AirPrint, Android printing and Mopria Print Service.
  • Produces wide-format prints up to 13" x 19".

Capture page rectangles

For controlled regions, use a screenshot clip rectangle instead of asking for a full-page image. Define each rectangle’s x/y origin and width/height, capture the region, then advance to the next one. With a long page, make sure the browser has rendered the content at each position; pages that load images lazily may need scrolling or other page-specific loading logic before capture. Clip support and related options are documented by Puppeteer as well; check the documentation for the version installed in your project before depending on a particular option combination.

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.

Playwright or Puppeteer?

Need Playwright Puppeteer
Full-page screenshot fullPage is documented in the Page API. fullPage is documented in ScreenshotOptions.
JPEG output and quality The API documents JPEG and a quality range from 0 to 100, with 80 as the default. The ScreenshotOptions page documents type and quality; check the installed version’s docs for defaults and option combinations.
Controlled capture region Use the screenshot clip option when capturing a specified region. The docs list clip and captureBeyondViewport.
Post-processing The screenshot buffer can be used for further processing. Consult the API documentation and your installed version for the output behavior needed by your workflow.

The cited documentation does not establish a performance winner. Prefer the library that already fits your runtime and browser configuration, then verify that its screenshot output and post-processing meet the tile dimensions you need. Puppeteer’s ScreenshotOptions interface displayed version 25.12.0 when accessed on October 3, 2026; use the documentation matching your installed version.

Rank #3
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⁴
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

  • The output is one tall image, not tiles: that is what fullPage: true requests. Add an image crop step or capture explicit page rectangles.
  • Images or styles are missing: check that their URLs are reachable from the browser and wait for the resources your page requires before capture. A page load event alone may not mean every application-specific asset is ready.
  • Tile edges do not line up: derive crop positions from the actual output pixel dimensions and use consistent tile sizes. Check whether your chosen scale or overlap changed the coordinate math.
  • The JPEG looks soft or has artifacts: raise the JPEG quality setting, or use PNG when preserving sharp text or transparency matters more than JPEG compression.
  • The screenshot is larger than expected: check the page’s rendered height and whether you used device-pixel scaling. CSS scale keeps output at CSS-pixel dimensions; device scale can increase pixel count.
  • A clip fails or captures the wrong region: verify that the clip rectangle is within the intended page coordinates, and consult the documentation for the installed Playwright or Puppeteer version.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A single request can return a screenshot in PNG, JPEG, or WebP, or a PDF; its image-resizing feature can help when you need a particular output size. This is a hosted screenshot rather than a general-purpose tile-cropping workflow, so use browser automation and image processing when you need exact tile coordinates.

For example, save a JPEG screenshot of a page with one GET request (see the ScreenshotNeo API docs):

Quick Recap

SaleBestseller No. 1
HP DesignJet T210 Large Format 24-inch Plotter Printer, for Easy CAD & Poster Prints (8AG32D)
HP DesignJet T210 Large Format 24-inch Plotter Printer, for Easy CAD & Poster Prints (8AG32D)
Media Handling: Sheet feed, roll feed, automatic horizontal cutter.; Connectivity: Gigabit Ethernet (1000Base-T), Hi-Speed USB 2.0, Wi-Fi 802.11 b/g/n.
$718.90
SaleBestseller No. 2
Epson Workforce Pro WF-7840 Wireless All-in-One Wide-Format Inkjet Printer
Epson Workforce Pro WF-7840 Wireless All-in-One Wide-Format Inkjet Printer
Built-in wireless (802.11a/b/g/n/ac) connection offers cable-free convenience.; Produces wide-format prints up to 13" x 19".
$229.99
Bestseller No. 4
Canon imagePROGRAF TC-21M – 24' Large Format Multifunction Printer
Canon imagePROGRAF TC-21M – 24" Large Format Multifunction Printer
USB FLASH DRIVE PORT - Easily print in large format by just inserting a USB Flash Drive.
$1,099.00
Rank #4
Canon imagePROGRAF TC-21M – 24" Large Format Multifunction Printer
  • ENLARGE COPY - Make enlargements of smaller originals directly from a letter flatbed scanner in a few simple steps.
  • USB FLASH DRIVE PORT - Easily print in large format by just inserting a USB Flash Drive.
  • 2.7” TOUCHSCREEN LCD - Get the job done with an easy to use tiltable 2.7” touchscreen LCD.
  • CLOUD PRINTING & SCANNING - Easily print to or scan from the cloud directly from the printer.
  • AUTO SHEET FEEDER - Automatically load up to 100 sheets of letter size paper or up to 50 sheets of 11” x 17” paper for greater print flexibility.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The request above uses the supplied example output filename; change the target URL to the page you want to capture and use a JPEG output setting if you need JPEG. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed; an MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

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 *

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.