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

Choose Puppeteer when your PDF must match a page after Chromium has executed its HTML, CSS, and JavaScript. Choose iText Core with the pdfHTML add-on when you are converting controlled HTML/CSS templates through iText and need its documented PDF/UA or PDF/A workflows. The choice is conditional: JavaScript, pagination, accessibility targets, deployment, and licensing matter more than a generic claim that one library is “better.”

The fundamental difference

Puppeteer prints a browser-rendered page

Puppeteer drives Chromium. Its Page.pdf() method generates a PDF using the print CSS media type by default. A typical workflow launches a browser, navigates to a URL, waits for the page to be ready, prints it, and closes the browser. The output therefore reflects Chromium’s layout engine, the page’s print styles, loaded fonts and images, and any JavaScript that finished changing the DOM before printing.

pdfHTML converts HTML and CSS through iText

pdfHTML is an add-on to iText Core. It parses HTML and CSS, maps them to iText objects and styles, and renders the result with the iText engine. It is intended for HTML/XML and CSS-based document templates rather than for emulating a live browser session.

pdfHTML does not evaluate JavaScript. If JavaScript constructs the final content, iText documents a two-stage approach: preprocess or render the page with a browser, then pass the resulting content to pdfHTML. That introduces an additional engine and requires validation of both visual fidelity and standards conformance.

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.

Decision guide

Requirement First candidate Reason and qualification
Client-side JavaScript creates or updates the final page Puppeteer Chromium can execute the page before printing. pdfHTML alone does not execute JavaScript.
Controlled, data-filled HTML/CSS templates iText Core + pdfHTML The template is converted through iText rather than laid out by a browser.
Browser-page fidelity, including existing print CSS Puppeteer The PDF follows Chromium’s rendered page and print media rules.
Documented PDF/UA or PDF/A workflows iText Core + pdfHTML iText documents support for PDF/UA-1, PDF/UA-2 and PDF/A variants in the cited feature information; validate your actual files.
Minimal browser runtime in deployment pdfHTML pdfHTML’s own conversion does not require a browser engine. JavaScript preprocessing would add one.
Permissive open-source license Puppeteer The Puppeteer repository uses Apache License 2.0 terms. Check the exact package and browser distribution you ship.
Commercial deployment under iText’s document-processing stack iText iText Core is offered under AGPLv3 or commercial licensing; the legal consequences depend on your distribution and deployment.

Generating a PDF with Puppeteer

This complete Node.js example navigates to a page, waits for fonts, selects print media, and writes a PDF. Adjust the URL and output path for your application.

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    headless: true
  });
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com/report', {
      waitUntil: 'networkidle0',
      timeout: 60000
    });

    await page.emulateMediaType('print');
    await page.evaluate(() => document.fonts.ready);

    await page.pdf({
      path: 'report.pdf',
      format: 'A4',
      printBackground: true,
      margin: {
        top: '18mm',
        right: '16mm',
        bottom: '18mm',
        left: '16mm'
      },
      preferCSSPageSize: true,
      displayHeaderFooter: false
    });
  } finally {
    await browser.close();
  }
})();

Install Puppeteer with npm install puppeteer. The package normally manages a compatible browser download; in restricted environments, configure the browser executable and verify that the runtime has the required libraries.

Important Puppeteer options

  • Media type: Page.pdf() uses print media by default. Call page.emulateMediaType('screen') only when the screen stylesheet is the intended source.
  • Paper and pagination: Use format or explicit width/height, margin, and pageRanges. preferCSSPageSize lets CSS @page size take priority.
  • Backgrounds: Set printBackground: true when colors or background images are part of the design.
  • Headers and footers: Set displayHeaderFooter: true and provide HTML templates through headerTemplate and footerTemplate. Keep expectations modest: these templates have restricted styling and no normal page JavaScript.
  • Readiness: networkidle0 is useful for pages that finish their requests, but analytics sockets or long polling can prevent it. In those cases, wait for a specific selector or a bounded delay instead.
  • Dynamic content: Wait for the application’s completion signal, then inspect the DOM. A navigation event alone does not prove that client-side rendering has finished.

Print CSS that prevents surprises

@media print {
  .no-print { display: none !important; }
}

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

.keep-together {
  break-inside: avoid;
}

Use print-only rules for navigation and interactive controls. Test long tables, images, nested flex or grid layouts, and elements that can split across pages. A browser screenshot is not evidence that the print layout is correct.

Generating a PDF with iText Core and pdfHTML

The Java example below converts a local HTML file into a PDF. It assumes iText Core and the pdfHTML add-on are included in your build using versions compatible with one another. The documented feature information cited for pdfHTML identifies version 6.3.3 with iText Core 9.7.0; verify current versions and support before implementation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import com.itextpdf.html2pdf.HtmlConverter;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class HtmlToPdf {
    public static void main(String[] args) throws Exception {
        try (FileInputStream html = new FileInputStream("invoice.html");
             FileOutputStream pdf = new FileOutputStream("invoice.pdf")) {
            HtmlConverter.convertToPdf(html, pdf);
        }
    }
}

For production documents, use pdfHTML conversion properties to control base URIs, resource resolution, fonts, and other supported behavior. Keep templates deterministic: populate data on the server, provide resolvable image and stylesheet URLs, and verify every CSS feature that affects pagination.

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.

What pdfHTML can and cannot imply

  • “HTML/CSS support” is not universal browser compatibility. Use iText’s current feature matrix to check every important element, selector, layout rule, font, and image type in your templates.
  • pdfHTML does not run scripts. A chart or total calculated in JavaScript will not appear unless your application computes it before conversion or you add a browser preprocessing stage.
  • iText documents workflows for PDF/UA-1, PDF/UA-2, and PDF/A variants. That documentation is not a guarantee that any arbitrary template is conforming. Validate tagging, metadata, fonts, color, reading order, and the finished file against the target standard.

Accessibility, archival output, and validation

These tools make different kinds of claims. iText’s cited documentation describes PDF/UA and PDF/A support in pdfHTML. Puppeteer’s current PDF options include a tagged option marked experimental and defaulting to true. Do not treat that option as proof of equivalent PDF/UA conformance. In either pipeline, run an appropriate validator and inspect representative files with assistive technology.

Validation should include headings and reading order, alternative text, table structure, links, language metadata, embedded fonts, page size, bleed or margins where relevant, and archival requirements. Include pages with missing images, long headings, lists, tables, and page breaks in the test set.

Licensing and deployment trade-offs

iText licensing

iText Core is available under AGPLv3 or commercial licensing. iText states that network deployment under AGPL requires disclosure of the full application source code, while a commercial license removes AGPL restrictions. Have counsel review your exact use, including SaaS access, redistribution, modifications, add-ons, and dependencies.

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.

Puppeteer licensing and runtime

The Puppeteer repository’s license page contains Apache License 2.0 terms. Your review must still cover the exact Puppeteer package, Chromium distribution, container image, fonts, and any additional dependencies. Operationally, Puppeteer requires a browser runtime, process lifecycle management, sandbox decisions, temporary storage, and resource limits. pdfHTML’s own conversion path does not require a browser, although JavaScript preprocessing would.

Performance, reliability, and cost: what is not established

Official documentation cited for this comparison does not provide a controlled, comparable measurement of speed, memory, throughput, latency, infrastructure cost, or scalability. Neither tool should be called faster or cheaper without benchmarking your actual HTML, fonts, images, concurrency, and deployment environment.

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.

For a meaningful internal test, use the same documents and output requirements, warm and cold runs, realistic concurrency, container limits, font loading, image sizes, failure rates, and PDF validation. Record browser startup time separately from page rendering, and record iText resource-loading and conversion time separately from application data preparation.

Troubleshooting common failures

The PDF is blank or missing JavaScript content

With Puppeteer, wait for a page-specific selector or application-ready flag after navigation, and inspect the DOM before calling page.pdf(). With pdfHTML, move the calculation into server-side generation or preprocess the page in a browser; pdfHTML itself will not execute the script.

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

Fonts or images are missing

Check that URLs are reachable from the conversion environment, that relative paths have a correct base URI, and that fonts are installed or supplied in the format supported by the chosen pipeline. In Puppeteer, wait for document.fonts.ready. In pdfHTML, configure resource resolution and test in the same container used in production.

Print layout differs from the browser view

Puppeteer prints with print media by default. Inspect @media print, call emulateMediaType('screen') only deliberately, and check preferCSSPageSize, margins, and backgrounds. A pdfHTML discrepancy usually means the template uses a CSS feature outside the supported matrix or relies on browser-specific behavior; simplify the rule or choose a supported equivalent.

Navigation never reaches network idle

Long polling, analytics, advertisements, or WebSocket activity can keep the network busy. Replace an unbounded network-idle wait with a page-specific readiness selector and a maximum timeout. Block nonessential requests only when doing so cannot change the document.

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

Pages break in the wrong places

Define paper size and margins explicitly, use print CSS such as break-inside: avoid where appropriate, and test content at its maximum realistic length. Browser and pdfHTML pagination engines are not interchangeable; validate the chosen engine’s output rather than relying on a screenshot.

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

The deployment fails to start

For Puppeteer, verify the browser executable, OS libraries, sandbox permissions, writable temporary directories, and process limits. For iText, verify that Core and pdfHTML versions are compatible, the license path is configured, and all resources are available to the conversion process.

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

When a two-stage pipeline makes sense

If a page depends heavily on JavaScript but the final document must enter an iText-based PDF/UA or PDF/A workflow, render or preprocess it in a browser first, then pass the resulting content to pdfHTML. Treat this as an engineering design, not an automatic compatibility layer: DOM serialization, computed styles, fonts, generated assets, semantics, and conformance all need tests.

A practical selection checklist

  • Is the final content present in the initial HTML, or created by JavaScript?
  • Must the PDF match Chromium’s print rendering, or is a controlled document template preferable?
  • Which HTML and CSS features are essential, and are they in the current pdfHTML support matrix?
  • Do you need a documented PDF/UA or PDF/A workflow, and how will you validate conformance?
  • Can your deployment operate a browser reliably, or should conversion remain browser-free?
  • Do AGPL obligations fit your distribution, or is commercial iText licensing required?
  • Have you benchmarked the real documents instead of assuming a performance winner?

Or skip the browser setup

If your immediate need is a clean screenshot or PDF of a web page rather than an application-controlled HTML-to-PDF pipeline, ScreenshotNeo provides a single-call alternative. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server supplies take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

For the API parameters and the complete option set, see the ScreenshotNeo documentation. A basic request 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

ScreenshotNeo includes full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can ease migration.

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.

The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing provides two months free. Create a free ScreenshotNeo account to try it.

Frequently Asked Questions

Can pdfHTML render a page that depends on JavaScript?

No. pdfHTML does not evaluate JavaScript. Compute the content before conversion or use a browser preprocessing stage and then validate the resulting pipeline.

Does Puppeteer guarantee PDF/UA compliance?

No. Its current tagged-PDF option is documented as experimental. Use a dedicated validator and do not equate it with iText’s documented PDF/UA workflows.

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.

Which option should a SaaS team choose?

Choose based on the page and legal requirements: Puppeteer for Chromium-rendered, JavaScript-heavy pages; iText plus pdfHTML for controlled templates and an acceptable AGPL or commercial licensing path. Benchmark your real workload.

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.