← 返回命令列表

Linux command

htmldoc 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Convert HTML to PDF

htmldoc --webpage -f [output.pdf] [input.html]

Convert to PostScript

htmldoc --webpage --format ps -f [output.ps] [input.html]

Convert multiple files

htmldoc --book -f [output.pdf] [chapter1.html] [chapter2.html]

Set page size

htmldoc --webpage --size [letter] -f [output.pdf] [input.html]

Add header

htmldoc --webpage --header [.t.] -f [output.pdf] [input.html]

说明

HTMLDOC converts HTML files to PDF or PostScript. It can process single pages or combine multiple HTML files into a book with table of contents and headers/footers. The tool is useful for generating printable documentation from HTML sources. It handles basic HTML and CSS, creating well-formatted output.

参数

--webpage
Single page mode.
--book
Multi-chapter book mode.
-f _file_
Output filename.
--format _format_
Output format: pdf, ps, html.
--size _size_
Page size: letter, a4, legal.
--landscape
Landscape orientation.
--header _format_
Header format.
--footer _format_
Footer format.
--title
Include title page.
--toc
Include table of contents.
--numbered
Number headings.
--gray
Grayscale output.

FAQ

What is the htmldoc command used for?

HTMLDOC converts HTML files to PDF or PostScript. It can process single pages or combine multiple HTML files into a book with table of contents and headers/footers. The tool is useful for generating printable documentation from HTML sources. It handles basic HTML and CSS, creating well-formatted output.

How do I run a basic htmldoc example?

Run `htmldoc --webpage -f [output.pdf] [input.html]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --webpage do in htmldoc?

Single page mode.