Skip to content
3 min readPublished Last reviewed

Why Does My HTML-to-PDF Conversion Lose Formatting?

Written and fact-checked by The EditPDF AI Team

A PDF is a fixed page size; a browser window is not. Most formatting problems come from that fundamental difference, plus a few common HTML/CSS issues.

Common causes

  • ·Fixed pixel-width layouts designed for a wide screen get cramped or cut off at page width
  • ·External stylesheets or fonts that failed to load because they required a login or were blocked
  • ·CSS that relies on viewport units (vw, vh) which behave differently on a fixed page than a resizable browser window
  • ·Elements positioned with absolute or fixed CSS positioning can land in unexpected spots on a paginated page

How to fix them

  1. 1Use relative or percentage-based widths instead of large fixed pixel values where possible.
  2. 2Host any custom fonts or stylesheets somewhere publicly reachable, or embed CSS directly in the HTML.
  3. 3Add explicit print/page-break CSS rules if you need control over where pages split.
  4. 4Avoid viewport units for layout-critical sizing; use fixed units or percentages instead.
How to Convert HTML to PDFLearn how to turn pasted or uploaded HTML into a PDF document, and what to check in the layout…How to Save a Webpage as a PDFDifferent ways to turn a live webpage into a PDF for archiving, sharing, or reading offline.Convert Word documents to PDFRebuild supported DOCX content in a new PDF layout
Core PDF tool

HTML to PDF

The core workflow is available without an account. Browser and tool-specific limits apply.

Try the converter free →

More convert guides

Browse all PDF guides →