← Back to Open-Source PDF Software

Open-Source PDF Software Capable of HTML to PDF Conversion

Render HTML/CSS to PDF

42 tools

C++

wkhtmltopdf

CliLibrary

Headless, command-line tool (and C library) that renders HTML into PDF using the Qt WebKit rendering engine, without requiring a display server. Can capture live URLs or local HTML.

DepreciatedStale
Go

Athenapdf

CliDockerServer

Docker-packaged drop-in alternative to wkhtmltopdf: a CLI (`athenapdf`, built on Electron) for direct HTML-to-PDF conversion with an 'aggressive mode' that strips page clutter, plus a `weaver` HTTP microservice (Go) for running conversions as a scalable, Kubernetes/AWS-ECS-deployable service.

DepreciatedStale
Haskell

Pandoc

Cli

Universal document converter between Markdown, HTML, LaTeX/ConTeXt, DOCX/RTF/ODT, EPUB, man/ms roff, DocBook, JATS, TEI, Jupyter notebooks, PowerPoint/reveal.js/Beamer slides, and dozens more formats. Uses external PDF-producing engines (context, latexmk, lualatex, pdflatex, xelatex, wkhtmltopdf, weasyprint, prince, pagedjs-cli, tectonic, pdfroff) to convert into PDF, and preserves metadata, footnotes, tables, math, syntax highlighting, and citations/bibliographies (via CSL) across formats.

Java

OpenPDF

Library

PDF creation/manipulation library: creates PDFs from scratch and modifies existing ones (add/remove pages, edit text); HTML-to-PDF conversion (openpdf-html module); text, fonts, graphics, images, and tables; page layout control; encryption and digital signing (via BouncyCastle); text extraction; PDF-to-image rendering (openpdf-renderer); and PDF 2.0 (ISO 32000-2) features including Brotli stream compression.

Java

itextpdf

Library

Legacy iText 5: core PDF creation/manipulation library (receiving security fixes only), with add-on modules for PDF 2.0 features (itext-xtra), PDF/A generation/validation (itext-pdfa), and XML/HTML-to-PDF conversion (xmlworker). Targets Java 5 compatibility, which blocks upgrading some vulnerable dependencies.

Depreciated
Java

Flying Saucer

Library

Renders well-formed XML/XHTML using CSS 2.1 layout/formatting to Swing panels, images, or PDF (via an OpenPDF-based renderer, or by delegating to a headless Chrome shell for modern HTML5/CSS3 support); also offers SWT output for Eclipse-based apps.

Java

neoFlyingSaucer

Library

Pure-Java HTML/CSS-to-PDF/image renderer, a modernization of Flying Saucer.

DepreciatedStale
Java

Open HTML to PDF

Library

Renders a practical subset of XML/XHTML/HTML5 with CSS 2.1+ (incl. CSS3 transforms, gradients, multiple backgrounds) to PDF or images, with SVG and MathML plugin support, accessible/tagged PDF output (Section 508, PDF/UA, WCAG 2.0), PDF/A compliance, font fallback and embedding, RTL/bidi text, footnotes, and file embedding via link download attributes.

Stale
JavaScript

DeckTape

Cli

Puppeteer-based (headless Chrome) command-line tool that exports HTML slide presentations to high-quality PDF, with native support for 13 frameworks (reveal.js, impress.js, remark, Bespoke.js, deck.js, etc.) plus a generic mode for others; can also capture slides as PNG/JPG images, export slide ranges, and set PDF metadata.

JavaScript

Electron-PDF

Cli

CLI tool and Node.js API (built on Electron/Chromium) that converts URLs, HTML files, or Markdown files to PDF or PNG, with custom CSS injection, page size/orientation/margin control, print-background support, custom request headers, and batch/concurrent job handling.

JavaScript

html-pdf-chrome

Library

Node.js library that renders HTML (local strings or remote URLs) to PDF using headless Chrome/Chromium, or exports as PNG/JPEG/WebP screenshots; supports templated headers/footers, custom HTTP headers, configurable viewport/device-scale, and multiple render-completion triggers (callbacks, DOM events, timers).

JavaScript

html2pdf.it

Server

Node.js web service that converts HTML (passed as a data URI) into PDF, supporting manual page breaks via CSS `page-break-before: always`.

Stale
JavaScript

html2pdf.js

Library

Client-side (browser-only) library built on html2canvas and jsPDF that converts a webpage, DOM element, or canvas into a PDF entirely in the browser, with configurable margins, page breaks, image quality/type, and a promise-based worker API. Renders content as images, so output text is not selectable/searchable and files can be large.

JavaScript

jsPDF

Library

Client-side JavaScript library for generating PDFs in the browser or Node: configurable paper size/orientation/units, text with 14 standard fonts or custom embedded TTF/Unicode fonts, images, transformation matrices, patterns, and FormObjects; plugin ecosystem adds HTML-to-PDF (via html2canvas) and table generation. Ships as ES module, UMD, or with TypeScript typings. (Originally MrRio/jsPDF, now hosted under github.com/parallax/jsPDF, which the old URL redirects to.)

JavaScript

markdown-resume.js

CliDriver

CLI tool (`md2resume`) that converts a Markdown resume into a responsive HTML page and a PDF version (via wkhtmltopdf), with a watch mode for live-reload editing and Docker support.

Stale
JavaScript

node-html-pdf

Library

PhantomJS-based library that converts HTML to PDF, PNG, or JPEG via a file/stream/buffer API, with paper size, orientation, margin, zoom, and header/footer options.

DepreciatedStale
JavaScript

pagedjs-cli

Cli

Command line interface for Paged.js, a free and open source library that paginates content in the browser to produce print-ready PDFs from HTML/CSS.

JavaScript

url-to-pdf-api

Server

Microservice (Puppeteer/headless Chrome) that converts URLs or posted HTML into PDFs or PNG/JPEG screenshots, with configurable viewport, PDF page size/orientation/margins/scale, header/footer templates, page-range selection, cookies/headers, SPA network-idle waiting, and optional API-key auth; deployable via Heroku or Docker.

Stale
Perl

PDF::WebKit

Library

Perl port of the Ruby PDFKit library: converts HTML strings, URLs, or files to PDF using wkhtmltopdf's WebKit rendering engine, with external stylesheet injection and PDF options settable via constructor args, global config, or HTML meta tags.

Stale
PHP

TCPDF

Library

Pure-PHP PDF/barcode generation library covering PDF/barcode generation, text/graphics, digital signatures, form fields, password/public-key encryption, and HTML/CSS rendering.

Depreciated
PHP

tc-lib-pdf

Library

UTF-8/RTL text with TrueType/OpenType/Type1/CID-0 font support and subsetting; HTML/CSS and SVG rendering with multi-column layouts, headers/footers, bookmarks, and TOC; JPEG/PNG/SVG images (plus GIF/BMP/TIFF/etc. via GD); RC4/AES-256 encryption; PAdES/PKCS#7 digital signatures with RFC 3161 TSA timestamps and LTV; PDF/A, PDF/X, and PDF/UA compliance modes; page import/reordering; AcroForm fields; and companion-package barcode support.

PHP

markdown-resume

CliDockerDriver

CLI/Docker tool that converts a Markdown resume into a responsive HTML5/CSS3 page and a PDF (via wkhtmltopdf), with selectable themes, a live-reload watch mode, word-frequency stats analysis, and single-file output with embedded styles.

Stale
PHP

mPDF

Library

Generates PDFs from UTF-8 HTML (including CJK content): headers/footers, page numbering, TOC, color handling, embedded fonts, zlib-compressed output, XML-driven charset conversion, basic SVG, and optional barcode generation (via bcmath). Notably lacks state-of-the-art CSS support compared to headless-Chrome-based alternatives.

PHP

browsershot

DriverLibrary

PHP package that drives headless Chrome (via Puppeteer) to convert a URL, HTML string, or local HTML file into a PDF or image; can also extract the rendered HTML body after JavaScript execution and list all network requests the page triggered.

PHP

Snappy

DriverLibrary

PHP wrapper around wkhtmltopdf/wkhtmltoimage that generates PDFs or image snapshots/thumbnails from URLs or HTML, merges multiple URLs into a single PDF, supports XSL-based tables of contents, and passes through wkhtmltox options (page size, margins, cookies, JS); includes Symfony, Laravel, and Zend Framework integrations.

PHP

Laravel PDF

Library

Laravel wrapper around mPDF: renders Blade views to PDF with data binding, custom headers/footers with page numbering, custom TTF fonts, document permission protection (copy/print/modify/extract/assemble), and per-file config overrides, with output via string, save, download, or browser stream.

DepreciatedStale
PHP

Dompdf

Library

Pure-PHP (no external PDF library) HTML-to-PDF converter: CSS 2.1 (with some CSS3) including @import/@media/@page rules, most presentational HTML 4.0 attributes, external/inline stylesheets, complex table rendering (spans, border models), GIF/PNG/BMP/JPEG images, basic SVG, inline PHP, and embedded fonts (bundled DejaVu TrueType for Unicode). Does not support CSS Flexbox/Grid or multi-page table cells.

PHP

Laravel Dompdf

Library

Laravel wrapper around Dompdf: converts HTML strings, files, or Blade views to PDF with paper size/orientation, DPI, fonts, CSS page breaks, and UTF-8 support; generates PDF/A-3b compliant output with embedded files and XMP metadata (for Zugferd/Factur-X e-invoicing); toggles JS/remote-content/PHP execution; outputs to disk, browser stream, download, or string.

PHP

Html2Pdf

Library

Converts specially-cleaned HTML (not arbitrary web pages) into PDF using TCPDF as the underlying engine, for generating documents like invoices and documentation; requires the gd and mbstring PHP extensions. Not designed to render existing websites or WYSIWYG-generated HTML directly.

PHP

laravel-snappy

Library

Laravel wrapper around the Snappy library: generates PDFs or images from HTML strings, files, or Laravel views, with output to file/browser/download, wkhtmltopdf/wkhtmltoimage option passthrough (paper size, orientation, margins), and a fake mode for testing without real rendering.

PHP

phpgearbox/pdf

DriverLibrary

Generates PDFs two ways: DOCX templating (variable substitution like `${FOO}`, block cloning, table row duplication, then converted to PDF) or HTML-to-PDF via PhantomJS.

DepreciatedStale
Python

PyFPDF

Library

Python port of the PHP FPDF library for generating PDFs: Unicode (UTF-8) TrueType font subset embedding, I2of5/Code39 barcodes (QR planned), PNG/GIF/JPG images (incl. transparency/alpha), and templates with a visual designer plus basic HTML-to-PDF.

Python

Python-PDFKit

DriverLibrary

Python wrapper around wkhtmltopdf: converts HTML from URLs, files, or strings (single or multiple at once) to PDF, with configurable wkhtmltopdf options, TOC generation, cover pages, external CSS, and HTML meta-tag-based settings.

DepreciatedStale
Python

WeasyPrint

Library

Python library that renders HTML and CSS to PDF using a custom Python-built CSS layout/pagination engine (not WebKit/Gecko), targeting print-oriented CSS/HTML standards for generating reports, invoices, tickets, and similar structured documents.

Python

xhtml2pdf

Library

Pure-Python HTML-to-PDF converter (built on ReportLab, html5lib, and pypdf) supporting HTML5 and CSS 2.1 (with some CSS3), with cairo or legacy RenderPM graphics backends for bitmap/vector output.

Python

fpdf2

Library

Unicode TrueType font subset embedding, cell/multi-cell/plaintext writing with automatic page breaks, optional Markdown-like text styling, image embedding with transparency, SVG import, arbitrary path drawing, table generation, internal/external links, barcodes/charts/emoji, document encryption and digital signing, annotations (highlights, file attachments), HTML-to-PDF conversion, basic math rendering, and TOC/outline generation.

Ruby

Wicked PDF

DriverLibraryPlugin

Rails plugin that uses wkhtmltopdf to render standard HTML views (or raw HTML/URLs/files) as PDF, avoiding a specialized PDF DSL: `format.pdf` controller responses, saving/emailing PDFs, CSS styling and JS execution, custom headers/footers, Rack middleware for `.pdf`-suffixed URLs, and an HTML debug-preview mode.

Ruby

PDFKit

DriverLibrary

Ruby gem that generates PDFs from HTML+CSS via wkhtmltopdf (WebKit rendering): converts HTML strings, URLs, or files; attaches stylesheets; passes cookies; configures default/global wkhtmltopdf options; and provides Rack/Rails middleware for `.pdf`-suffixed routes with forced-download support.

Stale
Ruby

Grover

DriverLibraryPlugin

Ruby gem that uses Puppeteer/headless Chromium (or Firefox) to convert URLs, inline HTML, local files, or Rails view templates into PDF, PNG, or JPEG: configurable page layout/margins/viewport, cookies/headers, CSS/JS injection, cover pages, HTTP basic auth, remote-browser connections, wait conditions (network idle, element visibility), and Rack middleware for URL-extension-triggered conversion.

Ruby

FerrumPdf

Library

Rails-oriented gem (headless Chrome via Ferrum, no Node.js dependency) that renders HTML/URLs to PDF (`render ferrum_pdf: {}`) with paper size/margin/orientation/scale options and dynamic headers/footers, or captures PNG/JPEG screenshots (`render ferrum_screenshot: {}`) of the full page, viewport, or a CSS-selected element.

Ruby

Princely

Library

Rails wrapper around the PrinceXML PDF generator: renders PDF templates via a `:pdf` render option, registers PDF as a respond_to MIME type, provides a `make_and_send_pdf` helper, and supports custom layouts/stylesheets/locals, asset path rewriting, inline/attachment disposition, JS and PDF-form flags, and configurable timeouts.

Scala

sPDF

DriverLibrary

Scala wrapper around wkhtmltopdf that generates PDFs from HTML/CSS/JS: accepts input as files, streams, URLs, Scala XML elements, or raw strings; writes to files or output streams; supports wkhtmltopdf's extended parameters (orientation, page size, margins); referenced images/stylesheets; async conversion via Scala `Future`; and a `WrappedPdf` mode for headless environments (e.g. via xvfb-run).

Stale