Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (111 sloc) 4.13 KB
.TH pdf2htmlEX 1 "Aug 31, 2012" "pdf2htmlEX 0.1"
pdf2htmlEX \- converts PDF to HTML without losing text and format.
pdf2htmlEX [options] <input\-filename> [<output\-filename>]
pdf2htmlEX is a utility that converts PDF files to HTML files.
pdf2htmlEX tries its best to render the PDF precisely, maintain proper styling, while retaining text and optmizing for Web.
Fonts are extracted form PDF and then embedded into HTML (Type 3 fonts are not supported). Text in the converted HTML file is usually selectable and copyable.
Other objects are rendered as images and also embedded.
.B --help
Show all options
.B -v, --version
Show copyright and version
.B -o, --owner-password <password>
Specify owner password
.B -u, --user-password <password>
Specify user password
.B --dest-dir <dir> (Default: ".")
Specify destination folder
.B --tmp-dir <dir> (Default: "/tmp/pdf2htmlEX")
Specify a folder for intermediate files
.B -f, --first-page <num> (Default: 1)
Specify the first page to process
.B -l, --last-page <num> (Default: last page)
Specify the last page to process
.B --zoom <ratio> (Default: 1.0)
Specify the zoom ratio of the HTML file
.B --hpdi <dpi>, --vpdi <dpi> (Default: 144)
Specify the horizontal and vertical DPI for images
.B --process-nontext <0|1> (Default: 1)
Whether to process non-text objects (as images)
.B --single-html <0|1> (Default: 1)
Whether to embed everything into one HTML file.
If switched out, there will be several files generated along with the HTML file including files for fonts, css, images.
.B --embed-base-font <0|1> (Default: 1)
Whether to embed base 14 fonts.
There are several base font defined in PDF standards, which are supposed to be provided by the PDF reader.
If this switch is on, local matched font will be used and embedded; otherwise only font names are exported such that web browsers may try to find proper fonts themselves.
.B --embed-external-font <0|1> (Default: 0)
Similar as above but for non-base fonts.
.B --decompose-ligature <0|1> (Default: 0)
Decompose ligatures. For example 'fi' -> 'f''i'.
.B --heps <len>, --veps <len> (Default: 1)
Specify the maximum tolerable horizontal/vertical offset (in pixels).
pdf2htmlEX would try to optimize the generated HTML file moving Text within this distance.
.B --space-threshold <ratio> (Default: 1.0/6)
pdf2htmlEX would insert a whitespace character ' ' if the distance between two consecutive letters in the same line is wider than ratio * font_size.
.B --font-size-multiplier <ratio> (Default: 10)
Many web browsers limit the minimum font size, and many would round the given font size, which results in incorrect rendering.
Specify a ratio greater than 1 would resolve this issue.
.B --always-apply-tounicode <0|1> (Default: 0)
A ToUnicode map may be provided for fonts in PDF which indicates the 'meaning' of the characters.
However often there is better "ToUnicode" info in Type 1 fonts, and sometimes the ToUnicode map provided is wrong. So by default pdf2htmlEX will find the Unicode value directly from the fonts instead of ToUnicode map. This behavior may be changed by turning on this switch.
.B --font-suffix <suffix> (Default: ".ttf"), --font-format <format> (Default: "truetype")
Specify the suffix and format of fonts extracted from the PDF file. They should be consistent.
.B --debug <0|1> (Default: 0)
Show debug information.
.B --clean-tmp <0|1> (Default: 1)
If switched off, intermediate files won't be cleaned in the end.
.B pdf2htmlEX /path/to/file.pdf
Convert file.pdf into file.html
.B pdf2htmlEX --tmp-dir tmp --clean-tmp 0 --debug 1 /path/to/file.pdf
Convert file.pdf and leave all intermediate files.
.B pdf2htmlEX --dest-dir out --single-html 0 --debug 1 /path/to/file.pdf
Convert file.pdf into out/file.html and leave font/image files separated.
Copyright 2012 Lu Wang <>
pdf2htmlEX is GPLv2 & GPLv3 dual licensed
pdf2htmlEX is written by Lu Wang <>
Home page