Chapter 8 - Command-Line Reference

This chapter describes all of the command-line options supported by HTMLDOC.

Note:

The free version of HTMLDOC for Windows does not include the command-line program.

Basic Usage

The basic command-line usage for HTMLDOC is: The first form converts the named HTML files to the specified output format immediately. The second form loads the specified .book file and displays the HTMLDOC window, allowing a user to make changes and/or generate the document interactively.

If no output file or directory is specified, then all output is sent to the standard output file.

Options

The following command-line options are recognized by HTMLDOC.

-d directory

The -d option specifies an output directory for the document files.

This option is not compatible with the PDF output format.

-f filename

The -f option specifies an output file for the document.

-t format

The -t option specifies the output format for the document and can be one of the following:

FormatDescription
htmlGenerate one or more indexed HTML files.
pdfGenerate a PDF file (default version - 1.3).
pdf11Generate a PDF 1.1 file for Acrobat Reader 2.0.
pdf12Generate a PDF 1.2 file for Acrobat Reader 3.0.
pdf13Generate a PDF 1.3 file for Acrobat Reader 4.0.
pdf14Generate a PDF 1.4 file for Acrobat Reader 5.0.
psGenerate one or more PostScript files (default level).
ps1Generate one or more Level 1 PostScript files.
ps2Generate one or more Level 2 PostScript files.
ps3Generate one or more Level 3 PostScript files.

-v

The -v option specifies that progress information should be sent/displayed to the standard error file.

--batch filename.book

The --batch option specifies a book file that you would like to generate without the GUI popping up. This option can be combined with other options to generate the same book in different formats and sizes:

--bodycolor color

The --bodycolor option specifies the background color for all pages in the document. The color can be specified by a standard HTML color name or as a 6-digit hexadecimal number of the form #RRGGBB.

--bodyfont typeface

The --bodyfont option specifies the default text font used for text in the document body. The typeface parameter can be one of the following:

typefaceActual Font
ArialHelvetica
CourierCourier
HelveticaHelvetica
MonospaceCourier
Sans-SerifHelvetica
SerifTimes
SymbolSymbol
TimesTimes

--bodyimage filename

The --bodyimage option specifies the background image for all pages in the document. The supported formats are BMP, GIF, JPEG, and PNG.

--book

The --book option specifies that the input files comprise a book with chapters and headings.

--bottom margin

The --bottom option specifies the bottom margin. The default units are points (1 point = 1/72nd inch); the suffixes "in", "cm", and "mm" specify inches, centimeters, and millimeters, respectively.

This option is only available when generating PostScript or PDF files.

--browserwidth pixels

The --browserwidth option specifies the browser width in pixels. The browser width is used to scale images and pixel measurements when generating PostScript and PDF files. It does not affect the font size of text.

The default browser width is 680 pixels which corresponds roughly to a 96 DPI display. Please note that your images and table sizes are equal to or smaller than the browser width, or your output will overlap or truncate in places.

--charset charset

The --charset option specifies the 8-bit character set encoding to use for the entire document. HTMLDOC comes with the following character set files:

charsetCharacter Set
cp-874Windows code page 874
cp-1250Windows code page 1250
cp-1251Windows code page 1251
cp-1252Windows code page 1252
cp-1253Windows code page 1253
cp-1254Windows code page 1254
cp-1255Windows code page 1255
cp-1256Windows code page 1256
cp-1257Windows code page 1257
cp-1258Windows code page 1258
iso-8859-1ISO-8859-1
iso-8859-2ISO-8859-2
iso-8859-3ISO-8859-3
iso-8859-4ISO-8859-4
iso-8859-5ISO-8859-5
iso-8859-6ISO-8859-6
iso-8859-7ISO-8859-7
iso-8859-8ISO-8859-8
iso-8859-9ISO-8859-9
iso-8859-14ISO-8859-14
iso-8859-15ISO-8859-15
koi8-rKOI8-R

--color

The --color option specifies that color output is desired.

This option is only available when generating PostScript or PDF files.

--compression[=level]

The --compression option specifies that Flate compression should be performed on the output file(s). The optional level parameter is a number from 1 (fastest and least amount of compression) to 9 (slowest and most amount of compression).

This option is only available when generating Level 3 PostScript or PDF files.

--continuous

The --continuous option specifies that the input files comprise a web page (or site) and that no title page or table-of-contents should be generated. Unlike the --webpage option described later in this chapter, page breaks are not inserted between each input file.

This option is only available when generating PostScript or PDF files.

--datadir directory

The --datadir option specifies the location of data files used by HTMLDOC.

--duplex

The --duplex option specifies that the output should be formatted for two sided printing.

This option is only available when generating PostScript or PDF files. Use the --pscommands option to generate PostScript duplex mode commands.

--effectduration seconds

The --effectduration option specifies the duration of a page transition effect in seconds.

This option is only available when generating PDF files.

--embedfonts

The --embedfonts option specifies that fonts should be embedded in PostScript and PDF output. This is especially useful when generating documents in character sets other than ISO-8859-1.

--encryption

The --encryption option enables encryption and security features for PDF output.

This option is only available when generating PDF files.

--firstpage page

The --firstpage option specifies the first page that will be displayed in a PDF file. The page parameter can be one of the following:

pageDescription
p1The first page of the document.
tocThe first page of the table-of-contents.
c1The first page of chapter 1.

This option is only available when generating PDF files.

--fontsize size

The --fontsize option specifies the base font size for the entire document in points (1 point = 1/72nd inch).

--fontspacing spacing

The --fontspacing option specifies the line spacing for the entire document as a multiplier of the base font size. A spacing value of 1 makes each line of text the same height as the font.

--footer lcr

The --footer option specifies the contents of the page footer. The lcr parameter is a three-character string representing the left, center, and right footer fields. Each character can be one of the following:

lcrDescription
.A period indicates that the field should be blank.
:A colon indicates that the field should contain the current and total number of pages in the chapter (n/N).
/A slash indicates that the field should contain the current and total number of pages (n/N).
1The number 1 indicates that the field should contain the current page number in decimal format (1, 2, 3, ...)
aA lowercase "a" indicates that the field should contain the current page number using lowercase letters.
AAn uppercase "A" indicates that the field should contain the current page number using UPPERCASE letters.
cA lowercase "c" indicates that the field should contain the current chapter title.
CAn uppercase "C" indicates that the field should contain the current chapter page number.
dA lowercase "d" indicates that the field should contain the current date.
DAn uppercase "D" indicates that the field should contain the current date and time.
hAn "h" indicates that the field should contain the current heading.
iA lowercase "i" indicates that the field should contain the current page number in lowercase roman numerals (i, ii, iii, ...)
IAn uppercase "I" indicates that the field should contain the current page number in uppercase roman numerals (I, II, III, ...)
lA lowercase "l" indicates that the field should contain the logo image.
tA lowercase "t" indicates that the field should contain the document title.
TAn uppercase "T" indicates that the field should contain the current time.

Setting the footer to "..." disables the footer entirely.

--format format

The --format option specifies the output format for the document and can be one of the following:

FormatDescription
htmlGenerate one or more indexed HTML files.
pdfGenerate a PDF file (default version - 1.3).
pdf11Generate a PDF 1.1 file for Acrobat Reader 2.0.
pdf12Generate a PDF 1.2 file for Acrobat Reader 3.0.
pdf13Generate a PDF 1.3 file for Acrobat Reader 4.0.
pdf14Generate a PDF 1.4 file for Acrobat Reader 5.0.
psGenerate one or more PostScript files (default level).
ps1Generate one or more Level 1 PostScript files.
ps2Generate one or more Level 2 PostScript files.
ps3Generate one or more Level 3 PostScript files.

--gray

The --gray option specifies that grayscale output is desired.

This option is only available when generating PostScript or PDF files.

--header lcr

The --header option specifies the contents of the page header. The lcr parameter is a three-character string representing the left, center, and right header fields. See the --footer option for the list of formatting characters.

Setting the header to "..." disables the header entirely.

--headfootfont font

The --headfootfont option specifies the font that is used for the header and footer text. The font parameter can be one of the following:

This option is only available when generating PostScript or PDF files.

--headfootsize size

The --headfootsize option sets the size of the header and footer text in points (1 point = 1/72nd inch).

This option is only available when generating PostScript or PDF files.

--headingfont typeface

The --headingfont options sets the typeface that is used for headings in the document. The typeface parameter can be one of the following:

typefaceActual Font
ArialHelvetica
CourierCourier
HelveticaHelvetica
MonospaceCourier
Sans-SerifHelvetica
SerifTimes
SymbolSymbol
TimesTimes

--help

The --help option displays all of the available options to the standard output file.

--helpdir directory

The --helpdir option specifies the location of the on-line help files.

--jpeg[=quality]

The --jpeg option enables JPEG compression of continuous-tone images. The optional quality parameter specifies the output quality from 0 (worst) to 100 (best).

This option is only available when generating Level 2 and Level 3 PostScript or PDF files.

--landscape

The --landscape option specifies that the output should be in landscape orientation (long edge on top).

This option is only available when generating PostScript or PDF files.

--left margin

The --left option specifies the left margin. The default units are points (1 point = 1/72nd inch); the suffixes "in", "cm", and "mm" specify inches, centimeters, and millimeters, respectively.

This option is only available when generating PostScript or PDF files.

--linkcolor color

The --linkcolor option specifies the color of links in HTML and PDF output. The color can be specified by name or as a 6-digit hexadecimal number of the form #RRGGBB.

--links

The --links option specifies that PDF output should contain hyperlinks.

--linkstyle style

The --linkstyle option specifies the style of links in HTML and PDF output. The style can be "plain" for no decoration or "underline" to underline links.

--logoimage filename

The --logoimage option specifies the logo image for the HTML navigation bar and page headers and footers for PostScript and PDF files. The supported formats are BMP, GIF, JPEG, and PNG.

--no-compression

The --no-compression option specifies that Flate compression should not be performed on the output files.

--no-duplex

The --no-duplex option specifies that the output should be formatted for one sided printing.

This option is only available when generating PostScript or PDF files. Use the --pscommands option to generate PostScript duplex mode commands.

--no-embedfonts

The --no-embedfonts option specifies that fonts should not be embedded in PostScript and PDF output.

--no-encryption

The --no-encryption option specifies that no encryption/security features should be enabled in PDF output.

This option is only available when generating PDF files.

--no-jpeg

The --no-jpeg option specifies that JPEG compression should not be performed on large images.

--no-links

The --no-links option specifies that PDF output should not contain hyperlinks.

--no-localfiles

The --no-localfiles option disables access to local files on the system. This option should be used when providing remote document conversion services.

--no-numbered

The --no-numbered option specifies that headings should not be numbered.

--no-pscommands

The --no-pscommands option specifies that PostScript device commands should not be written to the output files.

--no-strict

The --no-strict option turns off strict HTML conformance checking.

--no-title

The --no-title option specifies that the title page should not be generated.

--no-toc

The --no-toc option specifies that the table-of-contents pages should not be generated.

--no-xrxcomments

The --no-xrxcomments option specifies that Xerox PostScript job comments should not be written to the output files.

This option is only available when generating PostScript files.

--numbered

The --numbered option specifies that headings should be numbered.

--nup pages

The --nup option sets the number of pages that are placed on each output page. Valid values for the pages parameter are 1, 2, 4, 6, 9, and 16.

--outdir directory

The --outdir option specifies an output directory for the document files.

This option is not compatible with the PDF output format.

--outfile filename

The --outfile option specifies an output file for the document.

--owner-password password

The --owner-password option specifies the owner password for a PDF file. If not specified or the empty string (""), a random password is generated.

This option is only available when generating PDF files.

--pageduration seconds

The --pageduration option specifies the number of seconds that each page will be displayed in the document.

This option is only available when generating PDF files.

--pageeffect effect

The --pageeffect option specifies the page effect to use in PDF files. The effect parameter can be one of the following:

effectDescription
noneNo effect is generated.
biBox Inward
boBox Outward
dDissolve
gdGlitter Down
gdrGlitter Down and Right
grGlitter Right
hbHorizontal Blinds
hsiHorizontal Sweet Inward
hsoHorizontal Sweep Outward
vbVertical Blinds
vsiVertical Sweep Inward
vsoVertical Sweep Outward
wdWipe Down
wlWipe Left
wrWipe Right
wuWipe Up

This option is only available when generating PDF files.

--pagelayout layout

The --pagelayout option specifies the initial page layout in the PDF viewer. The layout parameter can be one of the following:

layoutDescription
singleA single page is displayed.
oneA single column is displayed.
twoleftTwo columns are displayed with the first page on the left.
tworightTwo columns are displayed with the first page on the right.

This option is only available when generating PDF files.

--pagemode mode

The --pagemode option specifies the initial viewing mode in the PDF viewer. The mode parameter can be one of the following:

modeDescription
documentThe document pages are displayed in a normal window.
outlineThe document outline and pages are displayed.
fullscreenThe document pages are displayed on the entire screen in "slideshow" mode.

This option is only available when generating PDF files.

--path dir1;dir2;dir3;...;dirN

The --path option specifies a search path for files that are loaded by HTMLDOC. It is usually used to get images that use absolute server paths to load.

Directories are separated by the semicolon (;) so that drive letters and URLs can be specified. Quotes around the directory parameter are optional. They are usually used when the directory string contains spaces.

--permissions permission

The --permissions option specifies the document permissions. The available permission parameters are listed below:

PermissionDescription
allAll permissions
annotateUser can annotate document
copyUser can copy text and images from document
modifyUser can modify document
printUser can print document
no-annotateUser cannot annotate document
no-copyUser cannot copy text and images from document
no-modifyUser cannot modify document
no-printUser cannot print document
noneNo permissions

The --encryption option must be used in conjunction with the --permissions parameter.

Multiple options can be specified with multiple --permissions entries as needed.

This option is only available when generating PDF files.

--portrait

The --portrait option specifies that the output should be in portrait orientation (short edge on top).

This option is only available when generating PostScript or PDF files.

--pscommands

The --pscommands option specifies that PostScript device commands should be written to the output files.

This option is only available when generating Level 2 and Level 3 PostScript files.

--quiet

The --quiet option prevents error messages from being sent to stderr.

--right margin

The --right option specifies the right margin. The default units are points (1 point = 1/72nd inch); the suffixes "in", "cm", and "mm" specify inches, centimeters, and millimeters, respectively.

This option is only available when generating PostScript or PDF files.

--size size

The --size option specifies the page size. The size parameter can be one of the following standard sizes:

sizeDescription
Letter8.5x11in (216x279mm)
A48.27x11.69in (210x297mm)
Universal8.27x11in (210x279mm)

Custom sizes are specified by the page width and length separated by the letter "x" to select a custom page size. Append the letters "in" for inches, "mm" for millimeters, or "cm" for centimeters.

This option is only available when generating PostScript or PDF files. Use the --pscommands option to generate PostScript page size commands.

--strict

The --strict option turns on strict HTML conformance checking. When enabled, HTML elements that are improperly nested and dangling close elements will produce error messages.

--textcolor color

The --textcolor option specifies the default text color for all pages in the document. The color can be specified by a standard HTML color name or as a 6-digit hexadecimal number of the form #RRGGBB.

--textfont typeface

The --textfont options sets the typeface that is used for text in the document. The typeface parameter can be one of the following:

typefaceActual Font
ArialHelvetica
CourierCourier
HelveticaHelvetica
MonospaceCourier
Sans-SerifHelvetica
SerifTimes
SymbolSymbol
TimesTimes

--title

The --title option specifies that a title page should be generated.

--titlefile filename

The --titlefile option specifies a HTML file to use for the title page.

--titleimage filename

The --titleimage option specifies the title image for the title page. The supported formats are BMP, GIF, JPEG, and PNG.

--tocfooter lcr

The --tocfooter option specifies the contents of the table-of-contents footer. The lcr parameter is a three-character string representing the left, center, and right footer fields. See the --footer option for the list of formatting characters.

Setting the TOC footer to "..." disables the TOC footer entirely.

--tocheader lcr

The --tocheader option specifies the contents of the table-of-contents header. The lcr parameter is a three-character string representing the left, center, and right header fields. See the --footer option for the list of formatting characters.

Setting the TOC header to "..." disables the TOC header entirely.

--toclevels levels

The --toclevels options specifies the number of heading levels to include in the table-of-contents pages. The levels parameter is a number from 1 to 6.

--toctitle string

The --toctitle options specifies the string to display at the top of the table-of-contents; the default string is "Table of Contents".

--top margin

The --top option specifies the top margin. The default units are points (1 point = 1/72nd inch); the suffixes "in", "cm", and "mm" specify inches, centimeters, and millimeters, respectively.

This option is only available when generating PostScript or PDF files.

--user-password password

The --user-password option specifies the user password for a PDF file. If not specified or the empty string (""), no password will be required to view the document.

This option is only available when generating PDF files.

--verbose

The --verbose option specifies that progress information should be sent/displayed to the standard error file.

--version

The --version option displays the HTMLDOC version number.

--webpage

The --webpage option specifies that the input files comprise a web page (or site) and that no title page or table-of-contents should be generated. HTMLDOC will insert a page break between each input file.

This option is only available when generating PostScript or PDF files.

--xrxcomments

The --xrxcomments option specifies that Xerox PostScript job comments should be written to the output files.

This option is only available when generating PostScript files.

Messages

HTMLDOC sends error and status messages to stderr unless the --quiet option is provided on the command-line. Applications can capture these messages to relay errors or statistics to the user.

BYTES: Message

The BYTES: message specifies the number of bytes that were written to an output file. If the output is directed at a directory then multiple BYTES: messages will be sent.

PAGES: Message

The PAGES: message specifies the number of pages that were written to an output file. If the output is directed at a directory then multiple PAGES: messages will be sent. No PAGES: messages are sent when generating HTML output.

ERRnnn: Messages

The ERRnnn: messages specify an error condition. Error numbers 1 to 14 map to the following errors:

  1. No files were found or loadable.
  2. No pages were generated.
  3. The document contains too many files or chapters.
  4. HTMLDOC ran out of memory.
  5. The specified file could not be found.
  6. The comment contains a bad HTMLDOC formatting command.
  7. The image file is not in a known format.
  8. HTMLDOC was unable to remove a temporary file.
  9. HTMLDOC had an unspecified internal error.
  10. HTMLDOC encountered a networking error when retrieving a file via a URL.
  11. HTMLDOC was unable to read a file.
  12. HTMLDOC was unable to write a file.
  13. A HTML error was found in a source file.
  14. A table, image, or text fragment was too large to fit in the space provided.

Error numbers 100 to 505 correspond directly to a HTTP status code.