dompdfui

A simple, friendly command line interface for creating PDFs from HTML files

Welcome! dompdfui helps you turn HTML documents and written pages into polished, downloadable PDF files — quickly and without fuss. You don't need to understand technical details to generate PDFs from HTML/CSS: dompdfui bundles a small PHP runtime and the Dompdf library into a single portable executable so you can convert local or remote HTML into printable, styled PDF documents.

Description

This is a small, portable command-line tool that combines "Static-PHP-cli" and the "Dompdf" library to convert HTML documents to PDF. The executable extracts a PHP interpreter and Dompdf into a temporary directory during runtime, performs the conversion, and cleans up after completion — so there are no external runtime dependencies to install.

What is this for?

Whether you need a shareable invoice, a printable report, a resume, or a saved copy of a webpage, dompdfui gives you an easy way to create PDFs while preserving CSS styling and layout. It supports local and remote stylesheets, embedded fonts (via @font-face), images and complex tables so your output looks like the original page.

How it helps people

  • Turn online content into offline copies you can keep or print.
  • Create professional-looking documents without design experience.
  • Save time: single-command to export and consistent formatting across pages.
  • Automatically generate reports in HTML/CSS and save them in PDF.
  • Bundle HTML, CSS and assets into automated pipelines (CI/CD) to produce PDFs as part of releases, invoices, or reports.
  • Preserve fonts and images by embedding or referencing them in CSS so printed output matches on-screen design.
  • Works offline — the tool is portable and extracts a runtime locally for environments without permanent PHP/Dompdf installs.
  • Accepts multiple input files to produce a set of PDFs in a single command, useful for batch conversions.
  • Helpful for developers, product managers, and non-technical users who need reliable, repeatable PDF output from styled HTML.

Command-line options

Usage: dompdfui [OPTIONS] INPUT-FILE1 [INPUT-FILE2] [...] OUTPUT-DIR

Short Option Long Option Default Description
-v --version Print version
-h --help Print help message
-m --php-memory-limit 268435456 Limits the amount of memory (in bytes) the PHP CLI can use
-f --force-out Replace output file if it exists
--isRemoteEnabled false Enable remote file access (images, fonts, stylesheets) when set to true
--isJavascriptEnabled true Enable inline JavaScript processing (if applicable)
--isFontSubsettingEnabled true Enable font subsetting to reduce output size
--sslAllowSelfSigned false Allow downloading assets from servers with self-signed or problematic SSL certificates (requires remote enabled)
--dpi 96 Image DPI setting; determines default DPI for images and fonts
--fontHeightRatio 1.1 Ratio applied to font height to better match browser line height
--defaultPaperSize a4 Default paper size (e.g. a4, letter, a3, etc.)
--defaultPaperOrientation portrait Page orientation: portrait or landscape
--allowedRemoteHosts List of allowed remote hostnames (can be specified multiple times) used to filter remote requests