To generate a PDF from HTML online, use a hosted HTML-to-PDF service; for a URL that needs JavaScript rendering or repeatable control, use Puppeteer’s Page.pdf(). If you want a downloadable PDF of a web page without setting up a browser, ScreenshotNeo’s PDF endpoint accepts a URL in one request. Choose based on whether you need an online workflow, control of the rendered browser, or a command-line batch process.
Choose the right way to convert HTML to PDF
| Approach | Best for | Trade-off |
|---|---|---|
| Hosted converter or API | Occasional online conversions or an application that should not manage a browser | Check the provider’s upload limits, data retention, privacy terms, JavaScript support, CSS fidelity, and pricing before sending a document or choosing a service. |
| Puppeteer | Modern JavaScript pages, repeatable automation, and detailed rendering control | You need to install and run a browser environment. PDFs use print styles by default. |
| wkhtmltopdf | Scripts and batch jobs that can use its Qt WebKit rendering model | It uses an older rendering engine; check whether your page’s CSS and JavaScript work as expected. |
There is no single best choice for every HTML document. A static file is straightforward to convert with a command-line tool. A site that builds its content in JavaScript may need a browser renderer. For sensitive content, review the hosted provider’s privacy and retention terms before uploading.
Generate a PDF online from a URL
A hosted service can convert a public web page or submitted HTML without requiring you to install a local browser. The exact workflow and supported features vary by provider: verify whether it runs page JavaScript, how it handles print CSS, what input size it accepts, and whether it stores submitted content. Those details are provider-specific and should not be assumed.
For a web page you want to capture as a PDF using a URL, ScreenshotNeo provides a PDF capture API. It is a website screenshot API and MCP server from Yorker Media. Its endpoint accepts a URL and returns a PDF; the API documentation lists the available PDF options. See ScreenshotNeo API documentation.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
For a simple request, replace YOUR_API_KEY with your key and change the target URL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The provided example saves a WebP image, not a PDF. For PDF output, use the PDF capture option documented for the endpoint and save the response with a .pdf filename. Check the documentation for the current parameter names and options rather than guessing them.
What to check before converting online
- JavaScript: Confirm the service renders client-side content that appears after the initial HTML response.
- Print layout: Check whether the service applies print styles, and whether it lets you set page size, margins, or orientation.
- Privacy: Review what happens to uploaded HTML, URLs, and generated PDFs, especially if they contain private or personal data.
- Failure handling: Determine how the service reports timeouts, blocked pages, and invalid input before building it into an automated workflow.
Use Puppeteer for browser-rendered HTML
Puppeteer’s Page.pdf() generates PDF bytes from a rendered page or writes them to a file. The official guide demonstrates navigating to a URL and saving hn.pdf. It waits for networkidle2 before generating the file. See the Puppeteer PDF generation guide.
Install Puppeteer in a Node.js project with npm install puppeteer, then save this as make-pdf.js:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.pdf({ path: 'output.pdf', format: 'A4' });
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Run it with node make-pdf.js. Replace https://example.com with the page you need. The finally block closes the browser even if navigation or PDF generation fails. For local HTML, navigate to a file URL instead of a web URL; ensure the HTML’s linked assets are accessible from the machine running the script.
Control page size, headers, and output
Page.pdf() supports settings including paper format, header and footer templates, output path, and tagged PDF support. The settings you choose depend on the document and Puppeteer version in your project; consult the Page.pdf() API reference for the current options. A format such as A4 is suitable for many international documents; use the format expected by your audience.
Print styles, colors, and page breaks
Puppeteer generates PDFs using the print CSS media type by default. That means the output may intentionally differ from the screen: a site can hide navigation, change font sizes, or rearrange content in @media print rules. If you need screen styles instead, call await page.emulateMediaType('screen') before page.pdf(). See Puppeteer’s PDF documentation.
Review the source page’s print rules for page breaks, margins, fonts, images, and backgrounds. Puppeteer notes that print colors are modified by default; when exact colors matter, CSS can use -webkit-print-color-adjust: exact. Test the resulting PDF because forcing exact colors may affect ink usage and visual contrast. Avoid relying on a large blank margin or browser defaults for a layout that must paginate predictably.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Up to 255 customize favorite scan file setting with "Single Touch" , Support Windows 7/8/10
- Turn paper documents into searchable, editable files - save scans as searchable PDF files; OCR function included
- Info Barcode function - automatic categorization of complicate documentation and data with 1D or 2D Barcode page.
- Intelligent color and image adjustments — Auto Rotate, Crop, Deskew and blank page remove with Plustek Image Processing Technology
- Easy send scanned files to FTP server or personal NAS (FTP) with PDFs , Jpeg , TIFF or Png format. User can download scanner driver from Plustek website
Convert HTML to PDF with wkhtmltopdf
wkhtmltopdf is a headless, open-source command-line renderer for HTML to PDF. Its project describes it as using the Qt WebKit rendering engine and also provides wkhtmltoimage for image output. See the wkhtmltopdf project.
After installing a build appropriate for your operating system, convert a URL with:
wkhtmltopdf https://example.com output.pdf
For a local HTML file, use its path as the input, for example wkhtmltopdf ./report.html output.pdf. The project documents options for paper size, margins, and related output controls; use the options supported by your installed build. Because the renderer is based on Qt WebKit, check the output carefully if the page depends on newer browser features or substantial client-side JavaScript.
Or skip the browser setup
For a URL-to-PDF workflow without installing and managing Puppeteer or wkhtmltopdf, ScreenshotNeo offers a PDF capture endpoint. The request pattern below shows the service’s documented base URL and a URL parameter; configure PDF output using the PDF option in the API documentation.
Rank #4
- Note: No software installation is required. You need 2 AA batteries ( not included) and a memory card ( included) to use it directly. Scan mode: Press and hold "Scan" for 2 seconds to turn on the device, and then press "Scan", the green light is on. The scanner moves to scan the file until the green light turns off automatically (or press the "Scan" key and the green light goes out). The number shown on the display increases by 1 to indicate that the scan is complete.
- Portable Scanner scans images or pictures quickly: Store JPEG/PDF files within seconds, scan images or pictures quickly, plug and play, no need any software preinstalled. Compatible with Windows XP/7/Vista/Mac OS 10.4 or above version.
- Lightweight and travel-friendly: Stored in Micro SD card directly, support read data on your computer or phone with USB connected. Powered by 2pcs AA batteries, Compact Design, it is convenient to carry outside.
- 3 Image Resolution: 3 modes of resolution for your options: 300dpi/600dpi/900dpi, you can save it at the clearest way, picture and document are showed clear as it is. Freely choose your favorite resolution.File Format: JPEG/PDF format is all available, Great storage capacity as it supports 32G Micro SD card(Included 16GB Card),total meet your need for business trip or daily use.
- Widely Used: It is applicable in bank, insurance business, real estate agency,home, office, library or outdoors. suitable for lawyer, businessmen, students, travelers and amateur archivists. Scan your important files and save them immediately, no struggling in finding a printing shop, keep it confidential.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o page.pdf
ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and whether the request was billed. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents using Claude, Cursor, or another MCP client. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try up to 1,000 screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting a bad or missing PDF
The PDF is blank or missing content
- For Puppeteer, confirm the target URL loaded successfully and that content is not added only after a later application event. If the page needs more time than network activity alone indicates, wait for a specific selector before calling
page.pdf(). - Check whether the content is excluded by print CSS. Compare the print layout with screen styles, and use
page.emulateMediaType('screen')only if screen rendering is the intended output. - For a hosted service, verify the URL is reachable by the service and check its documentation for JavaScript rendering and access restrictions.
Colors or backgrounds look different
PDF generation with Puppeteer uses print media and modifies colors for printing by default. Inspect @media print styles and use -webkit-print-color-adjust: exact when exact colors are required. Confirm the result in the generated file rather than assuming screen colors will carry through.
Pages break in the wrong places
Review print CSS for margins, page-break rules, image dimensions, and fonts. Set a paper format and any supported margins explicitly through Puppeteer’s PDF options or the options documented by your chosen CLI or online service. Different renderers may paginate the same HTML differently.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The command or script fails before saving
- For Puppeteer, confirm the package is installed, the browser can launch in the execution environment, and the process can reach the target page. Keep browser cleanup in a
finallyblock so failed jobs do not leave browser processes running. - For wkhtmltopdf, confirm the executable is installed and available on the system path, then check that the input URL or file can be opened from that machine.
- For a hosted API, check the API key, URL encoding, required output settings, timeout behavior, and the provider’s response or error details.
Performance, reliability, and cost considerations
Puppeteer and wkhtmltopdf run in your environment, so your workflow controls how jobs are scheduled and where the files are stored. Puppeteer provides modern browser rendering and JavaScript execution, but each conversion requires a browser process and page load. For repeated jobs, reuse a browser process carefully and close pages and browsers when work ends. A longer page load wait can improve completeness on some pages but also increases job time.
Best Value
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
A hosted converter avoids managing the browser runtime, but moves rendering and document handling to a provider. Before using one for production or confidential content, verify current pricing, request limits, retention policy, geography, JavaScript and CSS support, and how failures are reported. Do not infer those terms from the fact that a service offers online conversion.
For ScreenshotNeo, listed monthly plans are Free: 1,000 shots; Starter: $5 for 3,000; Growth: $15 for 15,000; Pro: $39 for 60,000; Scale: $99 for 250,000; and Business: $249 for 1,000,000. Yearly billing gives two months free, and every feature is on every plan. These are ScreenshotNeo plan terms; check its site for current details before purchasing.
Frequently Asked Questions
Does Puppeteer save the PDF directly to a file?
Yes. Pass an output path such as { path: 'output.pdf' } to page.pdf().
Recommended Free Tools
Can I generate a PDF from a local HTML file?
Yes. Use a file URL or a local path accepted by the renderer, and make sure linked assets are accessible to the process doing the conversion.
Does a PDF always look like the browser page?
No. Puppeteer uses print CSS by default, and other renderers may apply different CSS and pagination behavior. Inspect and test the generated PDF.
Quick Recap
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.




