Skip to content

HTMLDOC

Command-line converter from HTML and Markdown to PDF, EPUB and PostScript

Copyleft (OSI) · GPL-2.0
  • macOS
  • Linux
  • CLI

Listed by , founder & editor

57

Health

Active

Overview

Stars

253

Last commit

26 days ago

Oct 2026

Repository age

9 years

since Feb 2017

Latest version

v1.9.25

Oct 2026

Contributors

–

1 active in 90 days

Releases

4

last 12 months

Language

C++

HTMLDOC reads HTML and Markdown files or web pages and produces EPUB, HTML, PostScript or PDF output, with an optional table of contents. It began in the 1990s as a documentation generator and has been used as a report generator embedded in web servers.

You run it from the command line. Pass a list of source files and an output file, and it builds a structured document in which each H1 starts a new chapter. For plain web pages, add the webpage option. A GUI and web server mode exist, and the full manual is in the doc directory. It is written in C++, licensed under GPL-2.0, and available through Homebrew and Flathub on macOS and Linux.

It has clear limits. There is no CSS support, tables follow HTML 3.2 with basic TBODY and THEAD, and PDF encryption is the older 128-bit RC4. There is no right-to-left or non-Latin text support, and no PDF forms.

Who it's for

Developers generating PDF reports from simple HTML

A single command turns HTML files into PDF with a table of contents.

Skip if: Your templates rely on CSS, modern layout or Unicode scripts.

Technical writers producing manuals from HTML or Markdown

It builds chapters from H1 headings and outputs PDF, EPUB or HTML.

Skip if: You need Arabic, Chinese, Hebrew or Japanese text.

The problem it solves

You have HTML or Markdown documents and need a paginated PDF, EPUB or PostScript file without a word processor. HTMLDOC does that from the command line.

Strengths

  • Outputs PDF, EPUB, PostScript and HTML from HTML or Markdown
  • Simple command-line options, easy to script
  • Optional table of contents and chapter structure
  • Active: 4 releases in the last year
  • Available via Homebrew and Flathub

Trade-offs

  • No CSS support
  • Only HTML 3.2 tables with basic TBODY and THEAD
  • No right-to-left or non-Latin script support
  • PDF encryption is limited to RC4 128-bit, which is insecure

Self-host HTMLDOC

Self-hostable
No (desktop or local app)

Quick start

htmldoc -f outfile.pdf chapter1.html ... chapterN.html

From the project's own install instructions. Check the docs for production settings.

Frequently asked questions

Is HTMLDOC free?

Yes. It is open source under GPL-2.0.

Which formats does it produce?

EPUB, HTML, PostScript and PDF.

Does it support CSS?

No. CSS is not supported.

Can I use it for Chinese or Arabic text?

No. Languages that need dynamic rewriting or right-to-left layout are not supported.

Similar tools in PDF tools

PDF Converter

PDF tools

Android app that turns images into PDFs and edits existing PDF files

1.3k 802 11 months ago Dormant GPL-3.0

JSignPdf

PDF tools

Java desktop and command-line tool for digitally signing PDFs with keystores or smartcards

492 143 today Active MPL-2.0 AND LGPL-2.1-only

Signature PDF

PDF tools

Self-hosted web tool for signing, merging and compressing PDFs, alone or with others

837 112 33 days ago Active AGPL-3.0

mj_pdf

PDF tools

Private Android PDF reader with library, reading statuses and dark mode

753 18 3 months ago Slowing GPL-3.0

PDF Toolkit

PDF tools

Offline Android app for merging, splitting, signing and OCR-ing PDFs on your device

715 48 16 days ago Active Apache-2.0

Document Viewer

PDF tools

GNOME's document viewer for PDF and other document files on Linux and macOS

74 155 4 days ago Active GPL-2.0-or-later