Chapter 4 - HTMLDOC from the Command-Line

This chapter describes how to use HTMLDOC from the command-line to convert web pages and generate books.

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

Converting Web Pages

To convert a web page type: where output.pdf and output.ps are the names of the files you want to generate, and filename.html is the HTML file you are converting.

The --webpage option tells HTMLDOC that you want to convert a web page or other unstructured document.

The -f option tells HTMLDOC what file to generate. If you don't specify an output file then a PDF file is send to the standard output.

Generating Books

To generate a book from one or more HTML files type: where output.html, output.pdf, and output.ps are the names of the files you want to generate, and file1.html to fileN.html are the HTML files you want to use for the book.

The --book option tells HTMLDOC that you want to generate a book from the HTML file(s) you specified. HTMLDOC will build a table of contents for the book using the heading elements (H1, H2, etc.) in your HTML files. It will also add a title page using the document TITLE text and other META information you supply in your HTML files.

Setting the Title File

The --titlefile option sets the HTML file or image to use on the title page: HTMLDOC supports BMP, GIF, JPEG, and PNG images, as well as generic HTML text you supply for the title page(s).