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

For a one-off conversion, open the HTML in a browser and use Print → Save as PDF (or Print to PDF). For a private file, use a local browser or converter rather than uploading it. For repeatable jobs, use a local Chromium workflow such as Puppeteer; for automated conversion of live URLs at scale, consider a hosted API after checking how it handles your data.

Choose the right way to convert HTML to PDF

The best method depends on what you are converting and how often you need to do it. A static file, a JavaScript-heavy web page, and a batch of customer invoices have different requirements.

Need Good starting point Main tradeoff
One page, no coding Browser Print → Save as PDF Limited automation and repeatability
Sensitive local HTML Browser-local converter or local rendering tool Remote assets may be blocked or require setup
Repeatable rendering and layout control Puppeteer with Chromium Requires development and browser-runtime management
Simple command-line batch jobs wkhtmltopdf Its Qt WebKit rendering model may not handle modern CSS like current browsers
Hosted automation or live URL conversion HTML-to-PDF API HTML or page data leaves your device; review provider policies
.NET application SelectPdf or another .NET renderer Verify current licensing and vendor terms

Convert HTML with your browser

For a single page or file, a current desktop browser is usually the quickest option. It prints the page using print styles when supported, so the PDF may not look identical to the screen version.

  1. Open the HTML file in your browser, or navigate to the web page you want to save.
  2. Open the browser’s Print command. In many browsers, press Ctrl+P on Windows/Linux or Command+P on macOS.
  3. Choose Save as PDF or Print to PDF as the destination.
  4. Set paper size, orientation, and margins. Enable background graphics if the page’s colors or background images matter.
  5. Inspect the preview for clipped content and awkward page breaks, then save the PDF.

Browser labels vary by browser and operating system. If you do not see a PDF destination, check the printer or destination menu; some systems expose PDF saving through the operating system’s print dialog instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

When this method works best

  • The document is already open in a browser and you need one copy.
  • You can visually check the preview before saving.
  • You do not need a repeatable, unattended conversion process.

Print CSS and page layout

Web pages can have separate print styles. Rules inside @media print may hide navigation, change colors, or rearrange content. The @page rule can define page size and margins. If you control the HTML, test these rules in the browser’s print preview before automating conversion. Page breaks, background graphics, links, headers, and footers can all differ between the on-screen page and the saved PDF.

Convert HTML with Puppeteer and Chromium

For automated output using a modern browser engine, Puppeteer provides a JavaScript interface to Chromium. Puppeteer’s guide recommends Page.pdf() for printing PDFs. It uses the print CSS media type by default; call page.emulateMediaType('screen') when the screen stylesheet is the desired design. Install Puppeteer in a Node.js project, then use a script like this:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'networkidle0' });
    await page.pdf({
      path: 'output.pdf',
      format: 'A4',
      printBackground: true,
      margin: { top: '15mm', right: '12mm', bottom: '15mm', left: '12mm' }
    });
  } finally {
    await browser.close();
  }
})();

Save it as a JavaScript file in the project where Puppeteer is installed and run it with Node.js. Replace the URL and output path as needed. For local HTML, open its file URL instead; for HTML you generate dynamically, set the page content before calling page.pdf().

Useful PDF options

Puppeteer’s PDF options include paper format or explicit width and height, margins, landscape mode, headers and footers, page ranges, background printing, CSS page-size preference, scaling, tagged PDF output, and waiting for fonts. Use the options that match the document rather than relying on a default page size. For example, set landscape: true for wide tables or charts, and enable background printing when the design depends on filled backgrounds.

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

Wait for content that loads after the initial HTML response. networkidle0 can help with pages whose network activity settles, but it is not a universal signal that every application has finished rendering. If the page has a known readiness selector, wait for it explicitly with Puppeteer’s page wait methods. If print CSS is wrong for the intended result, switch to screen media before generating the PDF. Consult the PDF API documentation for the current option names and behavior.

Use wkhtmltopdf for command-line conversion

wkhtmltopdf is an open-source (LGPLv3) command-line tool that renders HTML into PDF and image formats using the Qt WebKit rendering engine. It runs headlessly, making it convenient for scripts and simple batch jobs.

wkhtmltopdf https://example.com output.pdf

Install the executable for your operating system using the project’s available distribution, then run the command in a terminal. To convert a local file, provide its file path or file URL as the input. Check the generated PDF rather than assuming a successful command means the layout is correct.

Rank #2
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⁴

Because this tool uses Qt WebKit rather than a current Chromium engine, test pages that rely on modern CSS, fonts, or JavaScript. Choose Puppeteer/Chromium if accurate current-browser rendering is important.

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

Convert HTML without uploading it

If a document contains private information, a local workflow avoids sending the HTML to a conversion provider. You can print it from a browser on your computer or run a local renderer such as Puppeteer or wkhtmltopdf. Local does not automatically mean identical output: the renderer still needs access to fonts, images, stylesheets, and scripts required by the page.

Falcon HTML to PDF documents a browser-local workflow that renders pasted or uploaded HTML inside a CSP-locked iframe and captures pages in the browser; it says the HTML does not leave the computer. Its documentation also says external images, fonts, and stylesheets are blocked. That restriction can protect against remote loading but means those assets may be missing from the result unless embedded. See Falcon HTML to PDF and its documentation for its stated behavior.

For any tool, distinguish the document from its dependencies. A local HTML file may reference remote resources, and an online converter may fetch a URL from its own servers. Before processing confidential material, establish whether the HTML, rendered page, and linked assets remain local or are uploaded, logged, or retained.

Use an online HTML-to-PDF service or API

A hosted converter can be useful when a team needs repeatable jobs, URL capture, or a shared conversion service. HTMLPDF.dev advertises raw-HTML and URL conversion, a browser playground, Chromium rendering, print and screen media modes, and SDK or HTTP access for several languages. Its advertised language options include Node.js, Python, PHP, Go, Ruby, .NET, Java, and cURL. Review its current service details at HTMLPDF.dev.

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

SelectPdf documentation describes conversion of full web pages, URLs, HTML files, and HTML strings, with a focus on .NET applications. It may be relevant if your application already uses .NET; verify current licensing and product terms directly before choosing it.

Check before sending a document to a service

  • Whether the service accepts your input type: raw HTML, a local file, or a public URL.
  • Whether it renders with print or screen styles, and how it handles JavaScript and external resources.
  • Its data-upload, logging, retention, and data-location policies, especially for sensitive documents.
  • Its limits, pricing, and error behavior for the volume you expect.
  • Whether generated files and links are private or publicly accessible.

Or skip the browser setup

If you need a PDF of a live web page rather than a PDF generated from raw HTML, ScreenshotNeo can return a PDF from one GET request. It is a website screenshot API and MCP server; the API also supports PDF settings such as paper size, margins, landscape, and page ranges. It is not a general raw-HTML-to-PDF service, so use a browser print or HTML renderer when your input is an HTML string or file.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

cURL example, using the documented API base and parameters (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

For a PDF response, request the PDF format and set any needed PDF options using the current API parameter names in the documentation. The example above saves an image response, not a PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
  • Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; responses identify the page verdict and billing status with headers.
  • An MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Make the PDF render correctly

Check the output for both appearance and completeness. A PDF can be valid while still omitting an image, cutting off a wide table, or splitting a heading from its content.

  1. Identify whether the input is raw HTML, a local file, or a live URL.
  2. Set and test print styles (@media print) and page geometry (@page, margins, and size).
  3. Wait for fonts, images, and JavaScript-rendered content before capture.
  4. Confirm whether external assets are embedded, blocked, or fetched remotely.
  5. Preview page breaks, background colors, links, headers and footers, and accessibility tagging.
  6. For sensitive material, check upload, logging, retention, and data-residency policies.
  7. If the PDF will be printed, inspect it in the target viewer and test a physical print where output accuracy matters.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common conversion problems

The PDF looks different from the web page

Browsers and automation tools may use print media styles by default. Check the page’s @media print rules and print preview; if you need screen styling in Puppeteer, call page.emulateMediaType('screen') before page.pdf().

Images, fonts, or scripts are missing

Confirm that assets load in the browser and that the renderer is allowed to access them. A browser-local workflow that blocks external resources will not include remote assets unless they are embedded. For dynamic content, wait for the application’s readiness condition rather than generating the PDF immediately after navigation.

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

Content is clipped or breaks across pages badly

Adjust paper size, orientation, margins, or scaling, then inspect the preview or regenerate the PDF. Review CSS page-size and page-break rules, especially for wide tables and large images. Use landscape orientation for content that is wider than the selected page.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art

The output is blank or incomplete

Check that the target URL or file opens successfully and that the page has finished rendering. JavaScript applications may display a shell before the actual content is ready; wait for a relevant selector or other application-specific signal.

A hosted service is unsuitable for private content

Do not assume that a conversion service keeps inputs local. Read its current policies for upload, logging, retention, and data location. If those terms do not meet your requirements, use a local browser or renderer and make sure required assets are available locally.

Frequently asked questions

Can I convert a local HTML file, not a website?

Yes. Open the file in a browser and print it to PDF, or pass it to a local rendering tool. Hosted URL converters generally need an accessible URL; check whether a specific service supports uploading files or raw HTML.

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.

Can JavaScript-generated content be included?

Yes, if the chosen browser or renderer runs the page’s scripts and you wait until the content is ready. For Puppeteer, navigate to the page, wait for its content or a known selector, then call page.pdf().

Does converting HTML to PDF guarantee an accessible, tagged PDF?

No. The result depends on the renderer and its settings. Puppeteer includes a tagged-PDF option, but you should check the generated document and your accessibility requirements rather than infer conformance from successful conversion.

Is an online converter always easier than a browser?

Not for a single page: the browser’s print dialog often needs no additional setup. A hosted service is more useful when you need repeatable automation or centralized conversion and its data handling suits the document.

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.

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