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.

The simplest free way to create a PDF from an HTML page is to open it in a modern browser, choose Print, then select Save as PDF. For repeatable or automated conversion, use Puppeteer when the page needs JavaScript and browser rendering, WeasyPrint for document-focused HTML/CSS and Python workflows, or wkhtmltopdf for a compact command-line conversion.

Choose the right free HTML-to-PDF method

Start with the way you need to use the result. A single manual save does not need a library. A repeatable job needs a command or program, and the choice of renderer affects whether JavaScript content, modern browser behavior, and print-specific CSS appear as expected.

Method Best fit Important trade-off
Browser Print One-off conversion by a person Output depends on the browser’s print engine and the page’s print CSS.
Puppeteer Node.js automation, especially pages populated with JavaScript Requires a browser-driven workflow; print media is used by default.
WeasyPrint Python pipelines and document-style HTML/CSS Not a full browser JavaScript renderer; untrusted HTML or CSS can create security risks.
wkhtmltopdf Simple command-line conversion Uses Qt WebKit, so test CSS and page breaks against the actual document.

All four routes can be used without paying for a conversion service. “Free” here means using built-in browser functionality or the named open-source tools; installation and maintenance still take time, and server automation may require infrastructure.

Save HTML as PDF with a browser

For one local HTML file or a web page, use the browser’s print dialog. Exact menu wording varies by browser and operating system, but the workflow is broadly the same.

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
  1. Open the HTML file in a current browser, or navigate to the web page you want to save.
  2. Open the browser’s Print dialog, commonly with Ctrl+P on Windows/Linux or Command+P on macOS.
  3. Choose Save as PDF or the equivalent PDF destination.
  4. Set paper size, orientation, margins, page range, and whether background graphics should print.
  5. Review the preview, save the file, then open the PDF and check its page breaks and content.

This route is suitable when a person can review each result. It is not a dependable batch-conversion workflow: browser settings, page loading, and print styles may need attention for each page. For pages that fill in after load, wait until the visible content is complete before opening Print.

Generate PDFs with Puppeteer in Node.js

Puppeteer is a strong default when HTML depends on JavaScript, browser APIs, or web fonts. Its official guide recommends Page.pdf() for printing PDFs. The method renders using print CSS by default; use page.emulateMediaType('screen') when the desired output should use screen styles instead. See the Puppeteer PDF generation guide and Page.pdf() API reference.

Install and run a local-file example

In a Node.js project, install Puppeteer with npm install puppeteer. The following script expects input.html in the current directory and writes output.pdf there:

const puppeteer = require('puppeteer');
const path = require('path');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    const fileUrl = 'file://' + path.resolve('input.html');
    await page.goto(fileUrl, { waitUntil: 'networkidle2' });
    await page.evaluate(() => document.fonts.ready);
    await page.pdf({
      path: 'output.pdf',
      printBackground: true,
      format: 'A4'
    });
  } finally {
    await browser.close();
  }
})();

To convert a web page instead, replace the fileUrl value with its URL. The example waits for network activity to settle and for document fonts to load, but neither condition guarantees that every application-specific asynchronous task has finished. If the page fetches data after initial navigation, wait for a known selector or other application-ready signal before calling page.pdf().

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

Control print appearance

By default, Puppeteer applies the page’s print media styles. Define rules such as @media print and @page in the HTML stylesheet to set print-specific visibility, paper size, margins, and page-break behavior. The format option above sets A4 paper; choose another supported paper format or specify dimensions if the document requires them. Setting printBackground: true includes backgrounds that may otherwise be omitted.

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⁴

The Puppeteer API reference notes that print output colors are modified by default. If exact colors matter, the page’s print CSS can use -webkit-print-color-adjust: exact. Check the resulting PDF rather than assuming that on-screen colors will match.

Convert HTML to PDF with WeasyPrint

WeasyPrint is suitable for document-style HTML and CSS when full browser JavaScript execution is not needed. It offers both a command-line interface and a Python API. Its official documentation demonstrates weasyprint https://weasyprint.org /tmp/weasyprint-website.pdf and the equivalent Python quick start; see WeasyPrint first steps and WeasyPrint API reference.

Python example for a local HTML file

Install WeasyPrint using the method appropriate for your operating system, following its installation documentation. Then save and run this script:

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

HTML(filename="input.html").write_pdf("output.pdf")

HTML accepts a filename, an absolute URL, a readable file object, or an HTML string. CSS can also be supplied separately. Use a filename for a local file; use a URL when the source is hosted and reachable from the conversion environment.

Command-line example

After installing WeasyPrint and ensuring its command is available on your path, convert a remote page like this:

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.
weasyprint https://weasyprint.org output.pdf

For a local source, run weasyprint input.html output.pdf. Remote images, fonts, and stylesheets must be reachable by the process. WeasyPrint’s documentation warns that using it with untrusted HTML or CSS can create security problems. Do not feed user-supplied content into a conversion service without considering resource access and applying appropriate isolation or restrictions.

Use wkhtmltopdf from the command line

wkhtmltopdf describes itself as open-source (LGPLv3) command-line tools that render HTML into PDF using the Qt WebKit rendering engine. Its basic patterns are wkhtmltopdf http://example.com output.pdf for a URL and wkhtmltopdf input.html output.pdf for a local file. See the wkhtmltopdf project.

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

This is a straightforward option when a compact CLI matters more than modern browser JavaScript fidelity. Because it uses Qt WebKit, verify your actual stylesheets, fonts, images, and page breaks in the generated file. If a page relies on client-side rendering, test whether its content is present before choosing this tool for unattended conversion.

Make the PDF readable and reliable

HTML-to-PDF conversion is a print-layout task, not simply a file-format change. A page that looks good in a browser viewport can split awkwardly on paper, omit backgrounds, or capture before its data is ready.

  • Wait for real readiness. Load completion and network-idle checks help, but application data may arrive later. For automated pages, wait for the specific content or state that must appear in the PDF.
  • Load fonts and assets. Confirm that stylesheets, images, and fonts are accessible to the converter. Local-file paths and remote resource permissions differ between environments.
  • Write print CSS. Use @media print for print-only rules and @page for page size and margins. Add page-break rules around content that should stay together or begin on a new page.
  • Choose backgrounds deliberately. Browser print settings and Puppeteer’s printBackground affect background graphics. Weigh the visual need against added ink-like coverage and file size.
  • Inspect the artifact. Open the PDF in its intended viewer and check page count, page breaks, selectable text, links, and images. A successful command only confirms that a file was produced, not that the document is correct.
  • Keep input boundaries in mind. Remote pages and user-provided HTML can reference other resources. For server-side conversion, consider network access and treat untrusted HTML/CSS cautiously, especially with WeasyPrint.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If the source is a web page and you want a PDF without managing a local browser-rendering stack, ScreenshotNeo provides a screenshot API and MCP server. Its PDF options include paper size, margins, landscape orientation, and page ranges. The one-call API returns a PDF when configured for PDF output; see the ScreenshotNeo documentation for request parameters and output settings.

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
curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o page.pdf

Set the PDF output option described in the API documentation for a PDF response. ScreenshotNeo can accept and remove cookie/consent banners, newsletter popups, and chat widgets before capture, with each step configurable. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status. An MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. It is a hosted service, so unlike the local methods above it requires an account and API key. Learn more at ScreenshotNeo.

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

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

Troubleshooting HTML-to-PDF conversion

  • JavaScript content is missing: The conversion may happen before the page’s data has rendered, or the selected renderer may not execute the page’s scripts. With Puppeteer, wait for a page-specific selector or ready state; use a browser-based renderer for dynamic content.
  • Fonts or images are absent: Check that resource URLs resolve from the converter’s environment, and wait for fonts before printing. For local HTML, verify relative paths and permissions.
  • Pages break in the wrong places: Add print CSS for page size, margins, and page breaks, then regenerate and inspect the PDF. Browser preview can reveal many layout problems before saving.
  • Colors or backgrounds differ: Enable background printing where supported. Puppeteer modifies print colors by default; use -webkit-print-color-adjust: exact in print CSS when exact color rendering is important.
  • WeasyPrint fails on supplied content: Check the HTML/CSS and referenced resources, and do not treat untrusted input as safe. Restrict fetching and isolate conversion according to your service’s security needs.
  • wkhtmltopdf layout differs from the browser: Its Qt WebKit engine may handle newer CSS or page breaks differently. Test the document with the actual engine and consider Puppeteer if browser fidelity or JavaScript is essential.
  • The PDF is blank or incomplete despite a successful run: Confirm the source URL/file opens independently, wait for asynchronous content, then inspect the generated PDF’s page count and text before scaling the workflow.

Which method should you use?

  • Choose browser Print for a one-off save you can preview and adjust manually.
  • Choose Puppeteer for Node.js automation or pages whose content depends on JavaScript and browser behavior.
  • Choose WeasyPrint for Python-based document generation where HTML/CSS layout is the main requirement and JavaScript is unnecessary.
  • Choose wkhtmltopdf when a simple CLI conversion fits and testing confirms the document renders correctly with its WebKit-based engine.

Frequently Asked Questions

Can I convert an HTML file to PDF without installing software?

Yes. Open the file in a modern browser, choose Print, and select Save as PDF.

Does Puppeteer generate PDFs using print styles or screen styles?

It uses print CSS by default. Call page.emulateMediaType('screen') before generating the PDF to use screen styles.

Which option is best for HTML that loads content with JavaScript?

Puppeteer is the safest default among these options because it renders pages in a real browser; wait for the page’s own content-ready condition before printing.

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

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.