← Back to Open-Source PDF Software

Open-Source PDF Software Capable of HTML to PDF Conversion

Render HTML/CSS to PDF

42 tools

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 like ads and navigation before rendering. Also ships a `weaver` HTTP microservice (written in Go) for running conversions as a scalable, horizontally-deployable service on Kubernetes or AWS ECS. Built on Electron/Chromium rather than the discontinued Qt WebKit engine wkhtmltopdf itself relies on.

DepreciatedStale
PHP

browsershot

DriverLibrary

PHP package that drives headless Chrome (via Puppeteer, run through a small Node.js bridge script) to convert a URL, HTML string, or local HTML file into a PDF or image, getting genuine modern browser rendering rather than a PDF-specific rendering engine's approximation. Can also extract the rendered HTML body after JavaScript execution completes and list every network request the page triggered — useful for debugging what a page actually loaded before capture.

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.

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.

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.

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.

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.

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

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.

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).

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.

JavaScript

html2pdf.it

Server

Node.js web service (not a library — you deploy or call an already-running instance) that converts HTML into PDF, with the HTML passed as a data URI in the request rather than a file upload. Supports manual page breaks via the CSS `page-break-before: always` rule, giving callers explicit control over pagination rather than relying purely on automatic content-flow breaking. A minimal, single-endpoint alternative to running a full headless-browser rendering pipeline yourself.

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.

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). Also reads existing PDFs via `PdfTextExtractor`. Targets Java 5 compatibility, which blocks upgrading some vulnerable dependencies.

Tested
Depreciated
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.)

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

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

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

markdown-resume

CliDockerDriver

CLI/Docker tool that converts a Markdown resume into a responsive HTML5/CSS3 page and a matching PDF (rendered via wkhtmltopdf), with selectable visual themes and a live-reload watch mode for editing. Also generates word-frequency stats analysis of the resume content, a distinctive extra not found in most other Markdown-to-resume tools in this directory. Outputs a single self-contained HTML file with embedded styles alongside the PDF.

Stale
JavaScript

markdown-resume.js

CliDriver

CLI tool (`md2resume`) that converts a Markdown resume into both a responsive HTML page and a PDF version, rendering the PDF via wkhtmltopdf under the hood. Includes a watch mode for live-reload editing while writing the resume, plus Docker support for running it without a local wkhtmltopdf install. One of several Markdown-to-resume tools in this directory (see also Kitabu, Gimli) built around the same 'write once, get HTML and PDF' workflow.

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.

Java

neoFlyingSaucer

Library

Pure-Java HTML/CSS-to-PDF and HTML-to-image renderer, positioned as a modernization of the original Flying Saucer project with updated dependencies and continued maintenance. Takes well-formed XHTML/XML styled with CSS 2.1 and lays it out using the same core rendering approach as Flying Saucer, producing PDF via an underlying PDF library rather than a browser engine. A lighter-weight alternative to browser-based HTML-to-PDF tools when the input HTML is already clean/well-formed rather than arbitrary web pages.

DepreciatedStale
JavaScript

node-html-pdf

Library

PhantomJS-based library that converts HTML to PDF, PNG, or JPEG via a file/stream/buffer API, with configurable paper size, orientation, margin, zoom, and header/footer options. No longer maintained since PhantomJS itself was deprecated years ago; its own README now directs users to migrate to a headless-Chrome/Puppeteer-based alternative instead, several of which appear elsewhere in this directory.

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
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.

Tested
JavaScript

pagedjs-cli

Cli

Command-line interface for Paged.js, a free and open-source library that paginates HTML/CSS content the way a browser would lay out a printed page, then produces print-ready PDFs from the result. Built specifically for CSS Paged Media use cases (page counters, running headers/footers, cross-references) that plain headless-browser screenshot-to-PDF pipelines don't handle correctly. Runs Paged.js inside a headless Chromium instance under the hood.

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.

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 as the actual conversion backend, with external stylesheet injection and PDF options (page size, margins, orientation) settable via constructor args, global config, or HTML meta tags embedded directly in the source document. Requires wkhtmltopdf itself installed as a system binary, since this module is a Perl API layer over it rather than a native PDF renderer.

Stale
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
PHP

phpgearbox/pdf

DriverLibrary

Generates PDFs two ways from the same package: DOCX templating (variable substitution like `${FOO}`, block cloning, table row duplication, then converted to PDF) for template-driven document generation, or direct HTML-to-PDF conversion via PhantomJS for cases where a DOCX template isn't the right fit. The DOCX-templating path is the more distinctive of the two, letting non-developers design the template layout directly in Word.

DepreciatedStale
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.

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.

Stale
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
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.

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
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

TCPDF

Library

Pure-PHP PDF and barcode generation library requiring no external extensions, covering text and vector graphics, digital signatures, form fields, password and public-key encryption, and HTML/CSS rendering for converting simple markup directly into PDF layout. One of the most widely deployed PHP PDF libraries historically, bundled by default with several major PHP CMS and e-commerce platforms rather than needing separate installation.

Depreciated
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
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.

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.

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 or window manager — long the default choice for server-side 'print this webpage to PDF' pipelines before headless Chrome existed. Can capture live URLs or local HTML files, applying the same CSS/JavaScript rendering a real browser would. Archived and unmaintained since Qt WebKit was deprecated; numerous language wrappers throughout this directory still drive it as a subprocess.

DepreciatedStale
Python

xhtml2pdf

Library

Pure-Python HTML-to-PDF converter built on ReportLab, html5lib, and pypdf, supporting HTML5 and CSS 2.1 (with partial CSS3) without any external browser or native rendering engine dependency. Offers a choice of cairo or the legacy RenderPM graphics backend for bitmap/vector output. Being pure Python with no headless-browser dependency eases deployment in restricted environments, at the cost of less complete modern-CSS support.