1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
|
htmldoc(1) Michael R Sweet htmldoc(1)
NNAAMMEE
htmldoc - convert html source files into html, postscript, or pdf.
SSYYNNOOPPSSIISS
htmldoc [options] filename1.{html,md} [ ... filenameN.{html,md} ]
htmldoc [options] -
htmldoc [filename.book]
DDEESSCCRRIIPPTTIIOONN
HHttmmllddoocc(1) converts HTML and Markdown source files into indexed HTML,
PostScript, or Portable Document Format (PDF) files that can be viewed
online or printed. With no options a HTML document is produced on std-
out.
The second form of hhttmmllddoocc reads HTML source from stdin, which allows
you to use hhttmmllddoocc as a filter.
The third form of hhttmmllddoocc launches a graphical interface that allows
you to change options and generate documents interactively.
CCOOMMMMOONN MMIISSTTAAKKEESS
There are two types of HTML files - structured documents using headings
(H1, H2, etc.) which hhttmmllddoocc calls "books", and unstructured documents
that do not use headings which hhttmmllddoocc calls "web pages".
A very common mistake is to try converting a web page using:
htmldoc -f filename.pdf filename.html
which will likely produce a PDF file with no pages. To convert web
page files you mmuusstt use the _-_-_w_e_b_p_a_g_e or _-_-_c_o_n_t_i_n_u_o_u_s options at the
command-line or choose _W_e_b _P_a_g_e or _C_o_n_t_i_n_u_o_u_s in the input tab of the
GUI.
OOPPTTIIOONNSS
The following command-line options are supported by hhttmmllddoocc:
----bbaattcchh _f_i_l_e_n_a_m_e_._b_o_o_k
Generates the specified book file without opening the GUI.
----bbooddyyccoolloorr _c_o_l_o_r
Specifies the background color for all pages.
----bbooddyyffoonntt _{_c_o_u_r_i_e_r_,_h_e_l_v_e_t_i_c_a_,_m_o_n_o_s_p_a_c_e_,_s_a_n_s_,_s_e_r_i_f_,_t_i_m_e_s_}
----tteexxttffoonntt _{_c_o_u_r_i_e_r_,_h_e_l_v_e_t_i_c_a_,_m_o_n_o_s_p_a_c_e_,_s_a_n_s_,_s_e_r_i_f_,_t_i_m_e_s_}
Specifies the default typeface for all normal text.
----bbooddyyiimmaaggee _f_i_l_e_n_a_m_e
Specifies the background image that is tiled on all pages.
----bbooookk
Specifies that the HTML sources are structured (headings, chap-
ters, etc.)
----bboottttoomm _m_a_r_g_i_n
Specifies the bottom margin in points (no suffix or ##pt), inches
(##in), centimeters (##cm), or millimeters (##mm).
----cchhaarrsseett _{_c_p_-_n_n_n_n_,_i_s_o_-_8_8_5_9_-_1_,_._._._,_i_s_o_-_8_8_5_9_-_1_5_,_u_t_f_-_8_}
Specifies the character set to use for the output. Note: UTF-8
support is limited to the first 128 Unicode characters that are
found in the input.
----ccoolloorr
Specifies that PostScript or PDF output should be in color.
----ccoonnttiinnuuoouuss
Specifies that the HTML sources are unstructured (plain web
pages.) No page breaks are inserted between each file or URL in
the output.
----ddaattaaddiirr _d_i_r_e_c_t_o_r_y
Specifies the location of the hhttmmllddoocc data files, usually
_/_u_s_r_/_s_h_a_r_e_/_h_t_m_l_d_o_c or _C_:_/_P_r_o_g_r_a_m _F_i_l_e_s_/_H_T_M_L_D_O_C_.
----dduupplleexx
Specifies that the output should be formatted for double-sided
printing.
----eeffffeeccttdduurraattiioonn _{_0_._1_._._._1_0_._0_}
Specifies the duration in seconds of PDF page transition effects.
----eemmbbeeddffoonnttss
Specifies that fonts should be embedded in PDF and PostScript out-
put.
----eennccrryyppttiioonn
Enables encryption of PDF files.
----ffoonnttssiizzee _s_i_z_e
Specifies the default font size for body text.
----ffoonnttssppaacciinngg _s_p_a_c_i_n_g
Specifies the default line spacing for body text. The line spacing
is a multiplier for the font size, so a value of 1.2 will provide
an additional 20% of space between the lines.
----ffooootteerr _f_f_f
Sets the page footer to use on body pages. See the HHEEAADDEERRSS//FFOOOOTTEERRSS
FFOORRMMAATTSS section below.
----ffoorrmmaatt _f_o_r_m_a_t
--tt _f_o_r_m_a_t
Specifies the output format: epub, html, htmlsep (separate HTML
files for each heading in the table-of-contents), ps or ps2 (Post-
Script Level 2), ps1 (PostScript Level 1), ps3 (PostScript Level
3), pdf11 (PDF 1.1/Acrobat 2.0), pdf12 (PDF 1.2/Acrobat 3.0), pdf
or pdf13 (PDF 1.3/Acrobat 4.0), or pdf14 (PDF 1.4/Acrobat 5.0).
----ggrraayy
Specifies that PostScript or PDF output should be grayscale.
----hheeaaddeerr _f_f_f
Sets the page header to use on body pages. See the HHEEAADDEERRSS//FFOOOOTTEERRSS
FFOORRMMAATTSS section below.
----hheeaaddeerr11 _f_f_f
Sets the page header to use on the first body/chapter page. See
the HHEEAADDEERRSS//FFOOOOTTEERRSS FFOORRMMAATTSS section below.
----hheeaaddffoooottffoonntt _f_o_n_t
Sets the font to use on headers and footers.
----hheeaaddffoooottssiizzee _s_i_z_e
Sets the size of the font to use on headers and footers.
----hheeaaddiinnggffoonntt _t_y_p_e_f_a_c_e
Sets the typeface to use for headings.
----hheellpp
Displays a summary of command-line options.
----hheellppddiirr _d_i_r_e_c_t_o_r_y
Specifies the location of the hhttmmllddoocc online help files, usually
_/_u_s_r_/_s_h_a_r_e_/_d_o_c_/_h_t_m_l_d_o_c or _C_:_/_P_r_o_g_r_a_m _F_i_l_e_s_/_H_T_M_L_D_O_C_/_D_O_C_.
----hhffiimmaaggeeNN _f_i_l_e_n_a_m_e
Specifies an image (numbered from 1 to 10) to be used in the
header or footer in a PostScript or PDF document.
----jjppeegg_[_=_q_u_a_l_i_t_y_]
Sets the JPEG compression level to use for large images. A value
of 0 disables JPEG compression.
----lleefftt _m_a_r_g_i_n
Specifies the left margin in points (no suffix or ##pt), inches
(##in), centimeters (##cm), or millimeters (##mm).
----lliinnkkccoolloorr _c_o_l_o_r
Sets the color of links.
----lliinnkkss
Enables generation of links in PDF files (default).
----lliinnkkssttyyllee _{_p_l_a_i_n_,_u_n_d_e_r_l_i_n_e_}
Sets the style of links.
----llooggooiimmaaggee _f_i_l_e_n_a_m_e
Specifies an image to be used as a logo in the header or footer in
a PostScript or PDF document, and in the navigation bar of a HTML
document. Note that you need to use the _-_-_h_e_a_d_e_r_, _-_-_h_e_a_d_e_r_1_,
and/or _-_-_f_o_o_t_e_r options with the _l parameter or use the corre-
sponding HTML page comments to display the logo image inthe header
or footer.
----nnoo--ccoommpprreessssiioonn
Disables compression of PostScript or PDF files.
----nnoo--dduupplleexx
Disables double-sided printing.
----nnoo--eemmbbeeddffoonnttss
Specifies that fonts should not be embedded in PDF and PostScript
output.
----nnoo--eennccrryyppttiioonn
Disables document encryption.
----nnoo--jjppeegg
Disables JPEG compression of large images.
----nnoo--lliinnkkss
Disables generation of links in a PDF document.
----nnoo--nnuummbbeerreedd
Disables automatic heading numbering.
----nnoo--ppssccoommmmaannddss
Disables generation of PostScript setpagedevice commands.
----nnoo--ssttrriicctt
Disables strict HTML input checking.
----nnoo--ttiittllee
Disables generation of a title page.
----nnoo--ttoocc
Disables generation of a table of contents.
----nnuummbbeerreedd
Numbers all headings in a document.
----nnuupp _p_a_g_e_s
Sets the number of pages that are placed on each output page.
Valid values are 1, 2, 4, 6, 9, and 16.
----oouuttddiirr _d_i_r_e_c_t_o_r_y
--dd _d_i_r_e_c_t_o_r_y
Specifies that output should be sent to a directory in multiple
files. (Not compatible with PDF output)
----oouuttffiillee _f_i_l_e_n_a_m_e
--ff _f_i_l_e_n_a_m_e
Specifies that output should be sent to a single file.
----oowwnneerr--ppaasssswwoorrdd _p_a_s_s_w_o_r_d
Sets the owner password for encrypted PDF files.
----ppaaggeedduurraattiioonn _I_{_1_._0_._._._6_0_._0_}
Sets the view duration of a page in a PDF document.
----ppaaggeeeeffffeecctt _e_f_f_e_c_t
Specifies the page transition effect for all pages; this attribute
is ignored by all Adobe PDF viewers.
----ppaaggeellaayyoouutt _{_s_i_n_g_l_e_,_o_n_e_,_t_w_o_l_e_f_t_,_t_w_o_r_i_g_h_t_}
Specifies the initial layout of pages for a PDF file.
----ppaaggeemmooddee _{_d_o_c_u_m_e_n_t_,_o_u_t_l_i_n_e_s_,_f_u_l_l_s_c_r_e_e_n_}
Specifies the initial viewing mode for a PDF file.
----ppaatthh
Specifies a search path for files in a document.
----ppeerrmmiissssiioonnss _p_e_r_m_i_s_s_i_o_n_[_,_p_e_r_m_i_s_s_i_o_n_,_._._._]
Specifies document permissions for encrypted PDF files. The fol-
lowing permissions are understood: all, none, annotate, no-anno-
tate, copy, no-copy, modify, no-modify, print, and no-print. Sepa-
rate multiple permissions with commas.
----ppssccoommmmaannddss
Specifies that PostScript setpagedevice commands should be
included in the output.
----qquuiieett
Suppresses all messages, even error messages.
----rreeffeerreerr _u_r_l
Specifies the URL that is passed in the Referer: field of HTTP
requests.
----rriigghhtt _m_a_r_g_i_n
Specifies the right margin in points (no suffix or ##pt), inches
(##in), centimeters (##cm), or millimeters (##mm).
----ssiizzee _p_a_g_e_s_i_z_e
Specifies the page size using a standard name or in points (no
suffix or ##x##pt), inches (##x##in), centimeters (##x##cm), or
millimeters (##x##mm). The standard sizes that are currently rec-
ognized are "letter" (8.5x11in), "legal" (8.5x14in), "a4"
(210x297mm), and "universal" (8.27x11in).
----ssttrriicctt
Enables strict HTML input checking.
----tteexxttccoolloorr _c_o_l_o_r
Specifies the default color of all text.
----ttiittllee
Enables the generation of a title page.
----ttiittlleeffiillee _f_i_l_e_n_a_m_e
----ttiittlleeiimmaaggee _f_i_l_e_n_a_m_e
Specifies the file to use for the title page. If the file is an
image then the title page is automatically generated using the
document meta data and title image.
----ttooccffooootteerr _f_f_f
Sets the page footer to use on table-of-contents pages. See the
HHEEAADDEERRSS//FFOOOOTTEERRSS FFOORRMMAATTSS section below.
----ttoocchheeaaddeerr _f_f_f
Sets the page header to use on table-of-contents pages. See the
HHEEAADDEERRSS//FFOOOOTTEERRSS FFOORRMMAATTSS section below.
----ttoocclleevveellss _l_e_v_e_l_s
Sets the number of levels in the table-of-contents.
----ttooccttiittllee _s_t_r_i_n_g
Sets the title for the table-of-contents.
----ttoopp _m_a_r_g_i_n
Specifies the top margin in points (no suffix or ##pt), inches
(##in), centimeters (##cm), or millimeters (##mm).
----uusseerr--ppaasssswwoorrdd _p_a_s_s_w_o_r_d
Specifies the user password for encryption of PDF files.
----vveerrbboossee
--vv Provides verbose messages.
----vveerrssiioonn
Displays the current version number.
----wweebbppaaggee
Specifies that the HTML sources are unstructured (plain web
pages.) A page break is inserted between each file or URL in the
output.
EEXXIITT SSTTAATTUUSS
HHttmmllddoocc returns a non-zero exit status if any errors are seen, zero
otherwise.
HHEEAADDEERR//FFOOOOTTEERR FFOORRMMAATTSS
The header and footer of each page can contain up to three preformatted
values. These values are specified using a single character for the
left, middle, and right of the page, resulting in the _f_f_f notation
shown previously.
Each character can be one of the following:
.. blank
// n/N arabic page numbers (1/3, 2/3, 3/3)
:: c/C arabic chapter page numbers (1/2, 2/2, 1/4, 2/4, ...)
11 arabic numbers (1, 2, 3, ...)
aa lowercase letters
AA uppercase letters
cc current chapter heading
CC current chapter page number (arabic)
dd current date
DD current date and time
hh current heading
ii lowercase roman numerals
II uppercase roman numerals
ll logo image
tt title text
TT current time
uu current filename or URL
EENNVVIIRROONNMMEENNTT
HTMLDOC looks for several environment variables which can override the
default directories, display additional debugging information, and dis-
able CGI mode:
HHTTMMLLDDOOCC__DDAATTAA
This environment variable specifies the location of hhttmmllddoocc's data
and fonts directories, normally /usr/share/htmldoc or C:/Program
Files/HTMLDOC.
HHTTMMLLDDOOCC__DDEEBBUUGG
This environment variable enables debugging information that is
sent to stderr. The value is a list of any of the following key-
words separated by spaces: "all", "links", "memory", "remote-
bytes", "table", "tempfiles", and/or "timing".
HHTTMMLLDDOOCC__HHEELLPP
This environment variable specifies the location of hhttmmllddoocc's doc-
umentation directory, normally /usr/share/doc/htmldoc or C:/Pro-
gram Files/HTMLDOC/doc.
HHTTMMLLDDOOCC__NNOOCCGGII
This environment variable, when set (the value doesn't matter),
disables CGI mode. It is most useful for using hhttmmllddoocc on a web
server from a scripting language or invocation from a program.
EEXXAAMMPPLLEESS
Create a PDF file from a web site:
htmldoc --webpage -f example.pdf http://www.example.com/
Create a PostScript book from a directory of HTML files
htmldoc --book -f example.pdf *.html
SSEEEE AALLSSOO
HTMLDOC Users Manual
https://michaelrsweet.github.io/htmldoc
AAUUTTHHOORR
Michael R Sweet
LLEEGGAALL SSTTUUFFFF
HTMLDOC is copyright (C) 1997-2017 by Michael R Sweet.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as pub-
lished by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 August 2017 HTMLDOC 1.9.1 htmldoc(1)
|