The dependable way to turn a URL into a PDF is to render the page in a browser engine, then save the rendered page as PDF. You can either call a managed HTML-to-PDF endpoint—such as Adobe PDF Services or Cloudflare Browser Run—or run Playwright yourself and use page.pdf(). The right choice depends on how much control and infrastructure you want to operate.
Choose between a managed API and your own browser
Both approaches perform the same essential work: they load the URL, execute the page, apply rendering rules, and generate a PDF. The difference is who runs the browser.
| Approach | What you send | What you operate | Best fit |
|---|---|---|---|
| Managed PDF API | A URL, or sometimes custom HTML | Your request code, authentication, and response handling | Applications that want a service endpoint without maintaining browsers |
| Playwright | A URL loaded in a browser page | Browser binaries, runtime capacity, navigation failures, and scaling | Teams needing browser-level rendering control or an existing automation stack |
Pricing, quotas, regions, request limits, and service guarantees vary by provider and change over time. Check the selected provider’s current documentation before committing to production use.
Convert a URL to PDF with Playwright
Playwright’s page.pdf() returns a PDF buffer. PDF generation uses print CSS media by default, so the output may differ from what visitors see on screen.
#1 Best Overall
- 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.
1. Install Playwright
npm install playwright
npx playwright install chromium
2. Load the URL and write the PDF
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
const pdf = await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true
});
await browser.close();
})();
format: 'A4' selects a documented page-size format; Playwright also documents Letter and explicit width and height values.
3. Use screen styles when print CSS is wrong
await page.emulateMedia({ media: 'screen' });
await page.pdf({ path: 'screen-styled.pdf', format: 'A4', printBackground: true });
Call emulateMedia before page.pdf() when the PDF should follow screen media rather than the default print media. Use explicit dimensions or a paper format when downstream printing or page-layout consistency matters.
Rank #2
- 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.
4. Make navigation and output predictable
- Set a navigation timeout appropriate for the sites you process.
- Wait for a selector or an application-specific ready signal when network idle is not enough.
- Use a fixed viewport and timezone if layout depends on them.
- Handle redirects, authentication, consent dialogs, bot checks, and pages that never finish loading.
- Close the browser in a
finallyblock in production code so failures do not leak processes.
Call a managed URL-to-PDF API
Adobe PDF Services
Adobe PDF Services documents creating PDFs from static or dynamic HTML, ZIP input, and a URL. Its REST HTML-to-PDF example uses an API-key header and a bearer-token header. Implement the exact request and response handling from Adobe’s current reference rather than mixing it with another provider’s format.
Cloudflare Browser Run
Cloudflare Browser Run documents a PDF endpoint that accepts either url or custom html; its documentation states, “You must provide either url or html.” REST calls require a token with Browser Rendering – Edit permission. Workers Bindings can call the endpoint without an API token.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- 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.
What to verify before production
- Whether the endpoint renders a public URL, authenticated pages, custom HTML, or all three.
- How credentials, cookies, redirects, and client-side JavaScript are handled.
- Paper sizes, margins, orientation, background graphics, page ranges, and print-versus-screen styling.
- Timeout behavior, retry guidance, response size limits, quotas, regions, and current pricing.
- Whether the response is returned synchronously or as an asynchronous job.
Common rendering problems
The PDF is blank or incomplete
The page may still be loading data when capture begins. Wait for a meaningful selector or application-ready state instead of relying only on a short delay. Also check that the target URL is reachable from the runtime and does not require an interactive login.
The layout looks different from the website
Print CSS is the default for Playwright PDFs. Emulate screen media when that is the intended appearance, and enable background printing when the design depends on colored backgrounds or images.
Rank #4
- 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
Images or fonts are missing
Wait until the page has loaded the relevant resources, confirm that the runtime can reach their hosts, and check for cross-origin or consent behavior that prevents them from loading.
The page keeps timing out
Some pages maintain open connections indefinitely. Use a targeted readiness condition, set a bounded timeout, and decide whether a failed capture should be retried or reported to the caller.
Best Value
- 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.
Or skip the browser setup
ScreenshotNeo is the first alternative to try when you want a URL-rendering API: it produces clean captures, bills only clean shots, and its paid plan starts at the lowest listed price.
One GET request can return a PNG, JPEG, WebP, or PDF. The service accepts the consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers. An MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for PDF response options and the other capture controls. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Quick Recap
Practical decision checklist
- Choose a managed endpoint if you want to avoid deploying and scaling browser workers.
- Choose Playwright if you need browser-level control, custom automation, or an existing Playwright environment.
- Choose URL input when the provider should fetch and render the page; choose HTML input when your application already owns the document.
- Test representative pages containing JavaScript, lazy images, fonts, consent dialogs, and long scrolling content before selecting a production design.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

