Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Convert PDF to HTML without losing format. Text is preserved as much as possible.

branch: master


A beautiful demo is worth a thousand words:

Typography Original

Full Circle Magazine(large) Sample Original

Formulas Original

Scientific Paper Original

Chinese Original


pdf2htmlEX renders PDF files in HTML, utilizing modern Web technologies, aims to provide an accuracy rendering, while keeping optimized for Web display.

It is optimized for modern web browsers.On Linux/Mac, the generated HTML pages could be as beautiful as PDF files.

This program is designed for scientific papers with complicate formulas and figures, therefore precise rendering is the #1 concern. But of course general PDF files are also supported.


  • Single HTML file output
  • Precise rendering
  • Text Selection
  • Font embedding & reencoding for Web
  • Proper styling (Color, Transformation...)
  • Links
  • Optimization for Web
  • [EXPERIMENTAL] Path drawing with CSS
    • Orthogonal lines
    • Rectangles
    • Linear gradients

Objects rendered as images

  • Type 3 fonts
  • Non-text object

Get started


PPA, which is not so up-to-date.


AUR Package, special thanks to Arthur Titeica


Homebrew Formula, special thanks to Jamie Ly

Macports (local repo), special thanks to Deepak Thukral


The code may be built with Cygwin.

Or with MinGW with some modifications.

More info can be found on the pdf2htmlEX page in TeX Wiki (in Japanese), special thanks to Haruhiko Okumura

Build from source


  • CMake, pkg-config
  • GNU Getopt
  • compilers support C++11, for example
    • GCC >= 4.4.6
    • I heard about successful build with Clang
  • poppler with xpdf header >= 0.20.0 (compile with --enable-xpdf-headers)
    • Install libpng (and headers) BEFORE you compile poppler if you want background images generated
    • Install poppler-data if your want CJK support
  • fontforge (with header files)
    • git version is recommended to avoid annoying compilation issues
  • [Optional] ttfautohint
    • run pdf2htmlEX with --external-hint-tool=ttfautohint to enable it


cmake . && make && sudo make install


pdf2htmlEX /path/to/foobar.pdf

pdf2htmlEX --help

man pdf2htmlEX

For Geeks

  • Experimental and unsupported

    pdf2htmlEX --process-nontext 0 --css-draw 1 /path/to/foobar.pdf


WINDOWS XP USERS: Please make sure ClearType is turned on

(Control Panel -> Display -> Appearance -> Effects -> "Use the following method to smooth edges of screen fonts" -> ClearType)


GPLv2 & GPLv3 Dual licensed

pdf2htmlEX is totally free, please credit pdf2htmlEX if you use it

Please consider sponsoring it if you use it for commercial purpose

Font extraction, conversion or redistribution may be illegal, please check your local laws

Donate Now


pdf2htmlEX is made possible thanks to the following projects:

pdf2htmlEX is inspired by the following projects:

  • pdftops & pdftohtml from poppler
  • MuPDF
  • PDF.js
  • Crocodoc
  • Google Doc


  • Lu Wang
    • Suggestions and questions are welcome.
    • Please read FAQ before sending an email to me. Or your message might be ignored.
    • Please use the latest master branch.
    • Expect me to be much more user-friendly than pdf2htmlEX.
    • Accepting messages in Chinese, English or Japanese.

Special Thanks

Something went wrong with that request. Please try again.