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.

To convert HTML to PDF with CSS Grid layouts intact, choose a renderer that supports the specific Grid features your page uses, then render and inspect representative pages at the intended paper size. There is no universal “CSS Grid supported” guarantee: WeasyPrint documents a useful subset with explicit limitations, Playwright uses print CSS by default, and Prince is a candidate for HTML-to-PDF conversion whose exact Grid coverage should be verified before relying on it.

Why CSS Grid can change in a PDF

A PDF is the output of a rendering and pagination process, not simply a saved browser screen. The renderer’s CSS implementation, the active media rules, paper dimensions, margins, and page breaks can all affect the result. A page that looks correct in a browser viewport may therefore look different after conversion, even if its Grid declarations are valid.

Start by listing the Grid features the page actually uses: track sizing, named areas, automatic placement, intrinsic sizing, subgrid, and any content that crosses page boundaries. Compare those needs with the renderer’s documented support rather than treating a general Grid label as a guarantee.

Choose a renderer based on the Grid features you need

Renderer What its documentation establishes What to verify
WeasyPrint Its stable API reference says CSS Grid Layout Module Level 2 “works for simple cases, but has some limitations.” It documents support for many common Grid properties, including grid containers, track definitions, flexible fr lengths, line names and areas, minmax(), gaps, alignment, dense auto flow, and fragmentation between rows. Check its unsupported or untested list against your layout. In particular, do not assume support for subgrid, auto-fill/auto-fit, inline-grid, column auto-flow, complex intrinsic sizing, or fragmentation in rows. See the WeasyPrint stable API reference.
Playwright The Playwright Page API documents page.pdf() and its output options. PDF generation uses print CSS by default; the API also documents how to emulate screen media before generating a PDF. Confirm the installed version’s options and test pagination in the Chromium version you use. The API description does not guarantee that every CSS feature or page will paginate as intended.
Prince Prince 15 is documented as an application for converting HTML and XML to PDF using CSS. Its documentation lists HTML, XHTML, XML, SVG, CSS, JavaScript/ECMAScript, and several image formats. See Prince Documentation 15 and the Prince Reference Guide. The cited documentation does not establish a specific CSS Grid support matrix. Check the current vendor documentation and test the Grid constructions your document depends on before choosing it.

WeasyPrint: useful for simple cases, but check its limits

WeasyPrint’s stable reference documents support for display: grid; grid-auto-*, grid-template-*, and other Grid properties and shorthands; flexible tracks; named lines and areas; automatic rows and columns; z-index; repeat(X, *); minmax(); alignment and gaps; dense auto flow; ordering; box styling; and fragmentation between rows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Its documented unsupported or untested cases include display: inline-grid, auto content size for Grid containers, grid-auto-flow: column, subgrids, repeat(auto-fill, *) and repeat(auto-fit, *), auto margins on Grid items, some uses of span, safe/unsafe and baseline alignment, intrinsic-size items such as images, distribution beyond limits, oversized Grid items, min/max sizing on Grid items, complex min-content/max-content cases, positioned or floating Grid items, and fragmentation in rows. Treat these as a checklist for your own document, not as proof that every unlisted combination works.

WeasyPrint also documents PDF features such as hyperlinks, bookmarks, attachments, and forms. Its font documentation notes that missing glyphs can trigger a warning and display a .notdef glyph, so check text and font coverage as well as layout.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Playwright: decide whether the PDF should use print or screen CSS

By default, page.pdf() renders with print media. If the document should use screen styles instead, call page.emulateMedia({ media: 'screen' }) before generating the PDF. This changes the media rules used; it does not itself guarantee that the result will fit or paginate correctly.

Playwright’s PDF options include paper format or explicit width and height, margins, background printing, scale, page ranges, tagged output, and whether CSS @page sizing takes priority. The documented defaults include Letter format, backgrounds off, and preferCSSPageSize set to false. Defaults can change between versions, so check the API documentation for the version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Prince: verify Grid coverage for the exact version

Prince is documented for print-oriented HTML/XML-to-PDF conversion with CSS and JavaScript support. The available documentation cited here does not confirm which Grid features it supports. Do not infer a particular Grid compatibility level from its broader CSS or PDF capabilities; test your layout and consult the current Prince documentation.

A reliable workflow for preserving the layout

  1. Inventory the CSS. Record Grid features, responsive breakpoints, image behavior, and any layout rules likely to interact with page breaks. Flag features the selected renderer marks unsupported or untested.
  2. Choose the output media. Decide whether the PDF should reflect print CSS or screen CSS. Add or refine print rules deliberately; do not assume the browser preview’s media mode will carry over.
  3. Set page geometry explicitly. Define paper size and margins, and decide whether backgrounds should print. With Playwright, review format, margins, printBackground, preferCSSPageSize, and media emulation as applicable.
  4. Render representative pages. Include the hardest cases: long content, images inside Grid items, page breaks, and the narrowest and widest layouts you expect to support.
  5. Inspect the PDF itself. Check page boundaries, column alignment, image sizing, missing glyphs, backgrounds, and content that might be clipped or split. Review it at its intended paper size, not just in an HTML preview.
  6. Validate separate output requirements. If the PDF must meet accessibility, archival, or print-production requirements, assess those independently; renderer selection alone does not establish compliance.

Playwright example: generate a PDF with explicit settings

This Node.js example assumes Playwright is installed and that page is an open page already navigated to the HTML you want to convert. It uses print media, prints backgrounds, and specifies paper size and margins. Adjust those settings to match the document; verify option availability against your installed Playwright version.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
await page.emulateMedia({ media: 'print' });
await page.pdf({
  path: 'output.pdf',
  format: 'A4',
  printBackground: true,
  preferCSSPageSize: true,
  margin: {
    top: '12mm',
    right: '12mm',
    bottom: '12mm',
    left: '12mm'
  }
});

To use screen media instead, change the emulation call to await page.emulateMedia({ media: 'screen' }) before page.pdf(). For a reusable implementation, also ensure the page has finished loading the content, fonts, and images the PDF needs before capture. Then inspect the resulting pages: a successful API call only means a PDF was generated, not that the layout is correct.

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

Troubleshoot “CSS Grid not working in PDF”

  • The PDF uses unexpected styles. Check whether the renderer is using print media. Playwright defaults to print CSS; explicitly emulate screen media only if that is the intended output.
  • Columns or tracks differ from the browser. Compare each Grid feature in use with the renderer’s support notes. For WeasyPrint, specifically test any reliance on subgrid, auto-fill/auto-fit, column auto-flow, intrinsic sizing, or other listed limitations.
  • Colors or images disappear. Check background-printing settings. Playwright’s documented default is backgrounds off; enable printBackground if backgrounds are required.
  • Content is clipped or split awkwardly. Check paper dimensions, margins, @page rules, scaling, and page ranges. Render the longest and most complex content, then inspect actual page boundaries.
  • Images inside Grid items distort or affect track size. Image sizing and intrinsic dimensions can interact with Grid support. Test representative image-heavy pages, especially with WeasyPrint, whose documentation lists intrinsic-size Grid items such as images among unsupported or untested cases.
  • Some text appears as a missing-character box. Confirm that the required font is available and contains the glyphs. WeasyPrint documents a warning and .notdef glyph for missing glyphs.
  • The PDF looks different across machines or upgrades. Record and validate the renderer and version used for production. For Playwright, check the installed version’s API documentation because defaults and behavior can change.

Performance, reliability, and cost considerations

The cited official documentation does not provide a controlled comparison of these renderers’ speed, price, or layout fidelity. Select on feature fit and output requirements, then benchmark your own representative documents if throughput or cost matters. For reliability, keep a repeatable set of test pages and inspect generated PDFs after renderer, browser, font, or stylesheet changes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

If you only need a screenshot of a webpage rather than a paginated PDF, ScreenshotNeo is a website screenshot API and MCP server. It is not a substitute for checking PDF pagination or print output. In a screenshot capture, its documented cleanup removes cookie and consent banners, newsletter popups, and chat widgets before capture; cleanup steps can be turned off. Its billing rules state that only clean shots are billed, while bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the result identified in response headers.

Or skip the browser setup

For a webpage screenshot—not a paginated HTML-to-PDF document—ScreenshotNeo offers a one-request capture. See the ScreenshotNeo API documentation.

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

Before the shot, cookie banners, popups, and chat widgets are removed. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.

Frequently Asked Questions

Can a screenshot API preserve CSS Grid in a PDF?

A webpage screenshot is an image capture, not a paginated PDF. Use an HTML-to-PDF renderer when you need paper layout, page breaks, or PDF output.

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

Does a generated PDF prove that the CSS Grid layout rendered correctly?

No. A successful generation only establishes that a PDF was produced; inspect its pages at the intended paper size for layout and content issues.

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.