| 1 |
.\" Copyright 1997-2025 Glyph & Cog, LLC |
| 2 |
.TH pdftohtml 1 "14 Nov 2025" |
| 3 |
.SH NAME |
| 4 |
pdftohtml \- Portable Document Format (PDF) to HTML converter |
| 5 |
(version 4.06) |
| 6 |
.SH SYNOPSIS |
| 7 |
.B pdftohtml |
| 8 |
[options] |
| 9 |
.I PDF-file |
| 10 |
.I HTML-dir |
| 11 |
.SH DESCRIPTION |
| 12 |
.B Pdftohtml |
| 13 |
converts Portable Document Format (PDF) files to HTML. |
| 14 |
.PP |
| 15 |
Pdftohtml reads the PDF file, |
| 16 |
.IR PDF-file , |
| 17 |
and places an HTML file for each page, along with auxiliary images |
| 18 |
in the directory, |
| 19 |
.IR HTML-dir . |
| 20 |
The HTML directory will be created; if it already exists, pdftohtml |
| 21 |
will report an error. |
| 22 |
.SH CONFIGURATION FILE |
| 23 |
Pdftohtml reads a configuration file at startup. It first tries to |
| 24 |
find the user's private config file, ~/.xpdfrc. If that doesn't |
| 25 |
exist, it looks for a system-wide config file, typically /etc/xpdfrc |
| 26 |
(but this location can be changed when pdftohtml is built). See the |
| 27 |
.BR xpdfrc (5) |
| 28 |
man page for details. |
| 29 |
.SH OPTIONS |
| 30 |
Many of the following options can be set with configuration file |
| 31 |
commands. These are listed in square brackets with the description of |
| 32 |
the corresponding command line option. |
| 33 |
.TP |
| 34 |
.BI \-f " number" |
| 35 |
Specifies the first page to convert. |
| 36 |
.TP |
| 37 |
.BI \-l " number" |
| 38 |
Specifies the last page to convert. |
| 39 |
.TP |
| 40 |
.BI \-z " number" |
| 41 |
Specifies the initial zoom level. The default is 1.0, which means |
| 42 |
72dpi, i.e., 1 point in the PDF file will be 1 pixel in the HTML. |
| 43 |
Using \'-z 1.5', for example, will make the initial view 50% larger. |
| 44 |
.TP |
| 45 |
.BI \-r " number" |
| 46 |
Specifies the resolution, in DPI, for background images. This |
| 47 |
controls the pixel size of the background image files. The initial |
| 48 |
zoom level is controlled by the \'-z' option. Specifying a larger |
| 49 |
\'-r' value will allow the viewer to zoom in farther without upscaling |
| 50 |
artifacts in the background. |
| 51 |
.TP |
| 52 |
.B \-noframe |
| 53 |
The default is to generate an \'index.html\' page with a sidebar |
| 54 |
listing all of the pages and a viewing area containing the current |
| 55 |
page in an HTML iframe. This option switches back to the older |
| 56 |
(pre-4.06) behavior of generating a very simple index page that just |
| 57 |
has links to the pages. |
| 58 |
.TP |
| 59 |
.BI \-vstretch " number" |
| 60 |
Specifies a vertical stretch factor. Setting this to a value greater |
| 61 |
than 1.0 will stretch each page vertically, spreading out the lines. |
| 62 |
This also stretches the background image to match. |
| 63 |
.TP |
| 64 |
.B \-embedbackground |
| 65 |
Embeds the background image as base64-encoded data directly in the |
| 66 |
HTML file, rather than storing it as a separate file. |
| 67 |
.TP |
| 68 |
.B \-nofonts |
| 69 |
Disable extraction of embedded fonts. By default, pdftohtml extracts |
| 70 |
TrueType and OpenType fonts. Disabling extraction can work around |
| 71 |
problems with buggy fonts. |
| 72 |
.TP |
| 73 |
.B \-embedfonts |
| 74 |
Embeds any extracted fonts as base64-encoded data directly in the HTML |
| 75 |
file, rather than storing them as separate files. |
| 76 |
.TP |
| 77 |
.B \-skipinvisible |
| 78 |
Don't draw invisible text. By default, invisible text (commonly used |
| 79 |
in OCR'ed PDF files) is drawn as transparent (alpha=0) HTML text. |
| 80 |
This option tells pdftohtml to discard invisible text entirely. |
| 81 |
.TP |
| 82 |
.B \-allinvisible |
| 83 |
Treat all text as invisible. By default, regular (non-invisible) text |
| 84 |
is not drawn in the background image, and is instead drawn with HTML |
| 85 |
on top of the image. This option tells pdftohtml to include the |
| 86 |
regular text in the background image, and then draw it as transparent |
| 87 |
(alpha=0) HTML text. |
| 88 |
.TP |
| 89 |
.B \-formfields |
| 90 |
Convert AcroForm text and checkbox fields to HTML input elements. |
| 91 |
This also removes text (e.g., underscore characters) and erases |
| 92 |
background image content (e.g., lines or boxes) in the field areas. |
| 93 |
.TP |
| 94 |
.B \-meta |
| 95 |
Include PDF document metadata as 'meta' elements in the HTML header. |
| 96 |
.TP |
| 97 |
.B \-table |
| 98 |
Use table mode when performing the underlying text extraction. This |
| 99 |
will generally produce better output when the PDF content is a |
| 100 |
full-page table. NB: This does not generate HTML tables; it just |
| 101 |
changes the way text is split up. |
| 102 |
.TP |
| 103 |
.B \-overwrite |
| 104 |
By default pdftohtml will not overwrite the specified output |
| 105 |
directory. If the directory already exists, pdftohtml will exit with |
| 106 |
an error. This option tells pdftohtml to instead overwrite the |
| 107 |
existing directory. |
| 108 |
.TP |
| 109 |
.BI \-opw " password" |
| 110 |
Specify the owner password for the PDF file. Providing this will |
| 111 |
bypass all security restrictions. |
| 112 |
.TP |
| 113 |
.BI \-upw " password" |
| 114 |
Specify the user password for the PDF file. |
| 115 |
.TP |
| 116 |
.B \-verbose |
| 117 |
Print a status message (to stdout) before processing each page. |
| 118 |
.RB "[config file: " printStatusInfo ] |
| 119 |
.TP |
| 120 |
.B \-q |
| 121 |
Don't print any messages or errors. |
| 122 |
.RB "[config file: " errQuiet ] |
| 123 |
.TP |
| 124 |
.BI \-cfg " config-file" |
| 125 |
Read |
| 126 |
.I config-file |
| 127 |
in place of ~/.xpdfrc or the system-wide config file. |
| 128 |
.TP |
| 129 |
.B \-v |
| 130 |
Print copyright and version information. |
| 131 |
.TP |
| 132 |
.B \-h |
| 133 |
Print usage information. |
| 134 |
.RB ( \-help |
| 135 |
and |
| 136 |
.B \-\-help |
| 137 |
are equivalent.) |
| 138 |
.SH BUGS |
| 139 |
Some PDF files contain fonts whose encodings have been mangled beyond |
| 140 |
recognition. There is no way (short of OCR) to extract text from |
| 141 |
these files. |
| 142 |
.SH EXIT CODES |
| 143 |
The Xpdf tools use the following exit codes: |
| 144 |
.TP |
| 145 |
0 |
| 146 |
No error. |
| 147 |
.TP |
| 148 |
1 |
| 149 |
Error opening a PDF file. |
| 150 |
.TP |
| 151 |
2 |
| 152 |
Error opening an output file. |
| 153 |
.TP |
| 154 |
3 |
| 155 |
Error related to PDF permissions. |
| 156 |
.TP |
| 157 |
98 |
| 158 |
Out of memory. |
| 159 |
.TP |
| 160 |
99 |
| 161 |
Other error. |
| 162 |
.SH AUTHOR |
| 163 |
The pdftohtml software and documentation are copyright 1996-2025 Glyph |
| 164 |
& Cog, LLC. |
| 165 |
.SH "SEE ALSO" |
| 166 |
.BR xpdf (1), |
| 167 |
.BR pdftops (1), |
| 168 |
.BR pdftotext (1), |
| 169 |
.BR pdfinfo (1), |
| 170 |
.BR pdffonts (1), |
| 171 |
.BR pdfdetach (1), |
| 172 |
.BR pdftoppm (1), |
| 173 |
.BR pdftopng (1), |
| 174 |
.BR pdfimages (1), |
| 175 |
.BR xpdfrc (5) |
| 176 |
.br |
| 177 |
.B http://www.xpdfreader.com/ |