Guides
Practical, tested advice and measured case studies for turning HTML into PDFs that look the way you intended.
Start here
Three overview guides that link to everything else.
The complete guide to print CSS for PDFs
One map of print CSS: what the page really is, which rules the converter obeys, and links to a tested guide for each step.
HTML to PDF not working? Every common problem and its fix
An illustrated symptom map of the eighteen most common HTML to PDF problems, each linked to a tested fix.
HTML to PDF for business documents: invoices, CVs, certificates and more
Which settings each business document needs, what an invoice must include, and a tested template for every common document.
How-to guides
How to convert HTML to PDF (code, files and webpages)
The three ways to get from HTML to PDF, which settings matter, and how to fix the most common problems.
CSS page breaks for PDF: control where pages start and end
The modern break properties, when to use each, and patterns for tables, headings and cards.
Print CSS for PDF: a practical checklist
A short, tested set of print rules that make HTML convert into a clean, readable PDF.
How to save a webpage as a PDF without cutting it off
The usual reasons a saved webpage loses its right edge or half its content, and how to fix each one.
Fonts and images in HTML to PDF: embed or link them correctly
How assets are loaded during conversion, and the reliable ways to include images and web fonts.
Create a PDF invoice from HTML (free template)
A copy-paste HTML invoice with print styles, plus tips for multi-page invoices.
Free HTML to PDF API: convert HTML or a URL with one request
Request formats, code examples, settings, limits and error codes for the HTML to PDF API.
Convert an HTML table to PDF without cut-off columns
Practical CSS for wide, long and dense tables, from landscape pages to repeating headers.
A4, Letter and Legal: page sizes for HTML to PDF in mm, inches and pixels
Exact page and printable-area dimensions to design HTML that fits A4, Letter and Legal PDFs.
Why your PDF is blank or missing content (JavaScript pages)
How the converter waits for a page, why late-loading content gets missed, and how to make it appear.
Charts in HTML to PDF: Chart.js, SVG and crisp output
Why charts come out blank, half-drawn or blurry in PDFs, and the settings that fix each problem.
Make a CV or résumé PDF from HTML (free template)
A copy-paste HTML CV that converts to a crisp, selectable PDF, with tips for fitting it on one page.
Markdown to PDF: convert notes and docs via HTML
A two-step route from Markdown to PDF with a stylesheet that makes documentation look polished.
HTML to PDF in JavaScript: browser print, html2pdf.js, Puppeteer or an API
The trade-offs between client-side libraries, headless Chrome and an API, with working code for each.
Page numbers, headers and footers in HTML to PDF
The CSS that puts page numbers and running headers on every page, tested against the fixed-header approach.
Add a DRAFT or CONFIDENTIAL watermark to an HTML PDF
A tested CSS watermark that repeats on every PDF page, and what it can and can’t protect.
Bootstrap or Tailwind columns stack in your PDF? Here’s why and how to fix it
Why col-md and md:grid-cols collapse to one column on A4, the measured page widths, and three fixes.
Clickable links and a table of contents in HTML to PDF
Tested: web, email and in-page links in the PDF, plus a table of contents that works.
Accessible PDFs from HTML: tags, title, language and alt text
What the PDF’s tag tree contains for each HTML element, tested, and how to write HTML that reads well with a screen reader.
Why your PDF has a blank extra page, and how to remove it
The 8-pixel body margin that adds an empty page, what doesn’t cause one, and how to find the culprit.
Free HTML certificate template: make a landscape PDF certificate
A tested landscape certificate template, the settings that keep it to one page, and a script for many names.
Convert an HTML email or newsletter to PDF
A tested table-based newsletter converted to PDF, and the details that differ from an inbox.
Background colours and images in HTML to PDF: what prints
Tested: which backgrounds print with the setting on and off, full-bleed page colour, and ink-saving CSS.
Save HTML as PDF in Chrome, Edge, Safari or Firefox (or use a converter)
Built-in Save as PDF in every major browser, the settings that matter, and when to use a converter instead.
Chinese, Arabic, Hindi and emoji in HTML to PDF
A tested list of scripts that work out of the box, the lang attribute that picks the right Chinese glyphs, and right-to-left text.
HTML form to PDF: why fields aren’t fillable, and how to make a printable form
What each form control looks like in the PDF, the traps (placeholders, clipped text), and a write-in form you can print.
Blurry logo or QR code in your PDF? Use SVG or higher-resolution images
Measured: images print at their own pixels, canvases at 96 ppi, and SVG as sharp vectors with selectable text.
Images missing from your PDF? Lazy loading is the usual cause
We ran each lazy-loading pattern five times. Native lazy images near the top were usually blank; plain images never were.
Code blocks in PDF: syntax highlighting without cut-off lines
Measured: overflow: auto silently clips long lines, overflow: visible shrinks the page. One print rule fixes both.
Two-column layouts, justified text and hyphenation in HTML to PDF
CSS columns flow across pages cleanly; hyphenation works only with a lang attribute. Tested examples and copy-paste CSS.
Iframes, videos and embeds in HTML to PDF: what you get
Tested: iframes are clipped to their frame, videos print their poster image, and how to replace both in a PDF.
Make any webpage print-ready: a 10-line CSS makeover
A real before-and-after: what sidebars, cookie banners and sticky share buttons do to a PDF, and the ten lines that fix it.
Is it safe to convert HTML to PDF online? What happens to your document
A step-by-step look at where your HTML goes, what is and isn’t kept, and a checklist for deciding what to upload.
Mail merge to PDF: one PDF per row of a spreadsheet
Fill an HTML template from each row of a CSV, convert it with the free API, and save one named PDF per person, safely.
Printable name badges: an HTML template for 10 badges per A4 sheet
A ready-to-edit badge sheet built with CSS grid and millimetres, measured to fit ten badges on one A4 page.
Case studies
Real conversions on htmltopdf.online, measured before and after a fix.
Case study: the invoice whose total landed alone on page two
A real conversion where “Total due” was stranded on page two, and the CSS that kept the totals together.
Case study: a 12-column sales table, shrunk, clipped and fixed
Measured results for a wide table: whole-page shrinking, four silently missing columns, and two fixes.
Case study: Chart.js bars at 7% height in a PDF
A real chart captured mid-animation, and the one-line Chart.js option that fixed it.
Case study: which fonts actually end up in your PDF
A font-by-font test of what the converter really embeds, including Verdana becoming a serif font.
Case study: one photo, four ways, from 19 KB to “too large”
How image format and size changed a one-page PDF from 19 KB to rejected, with exact numbers.
Case study: a 1,000-row report, with and without repeating headers
One change to the table markup put column headings on every page of a 23-page report.