这是 pdf2htmlEX 0.12 版本的帮助手册. 也可以直接在命令行执行 man pdf2htmlEX 来查看最新的帮助手册.
如果发现本文档过期了,可以通过发起 issue 来通知我。
pdf2htmlEX(1) pdf2htmlEX 通用手册 pdf2htmlEX(1)NAMEpdf2htmlEX - 将 PDF 转换成 HTML(保持原有的文本和格式)。用法pdf2htmlEX [options] <input-filename> [<output-filename>]描述pdf2htmlEX 是一个将 PDF 转换成 HTML 文件的工具.pdf2htmlEX 尝试准确的转换 PDF, 保留适当的样式和文本, 而且还会为 Web 展示做优化。从 PDF 中提取到的字体会被嵌入到 HTML 中( Type 3 号字体暂不支持)。 转换后的 HTML 文件中的文本通常是可以被选中和复制的。其他对象会被渲染为图像并嵌入到 HTML 中。选项页面相关-f, --first-page <num> (默认值: 1)指定要处理的第一页是那一页-l, --last-page <num> (默认值: 最后一页)指定最后要处理的是那一页Dimensions--zoom <ratio>, --fit-width <width>, --fit-height <height>--zoom 指定了缩放因子; --fit-width/height指定了页面的最大宽度和高度, 单位是像素.如果指定了多个值,会使用最小值。如果没有指定, 页面将以 72DPI 的规格来渲染.--use-cropbox <0|1> (默认值: 1)使用 CropBox 来代替 MediaBox 作为输出.--dpi <dpi> (默认值: 144)指定图像的横向和纵向的 DPI 。输出--embed <string>--embed-css <0|1> (默认值: 1)--embed-font <0|1> (默认值: 1)--embed-image <0|1> (默认值: 1)--embed-javascript <0|1> (默认值: 1)--embed-outline <0|1> (默认值: 1)指定哪些元素会被嵌入到输出的 HTML 文件中。如果被关闭, 对应的组成部分(CSS、font、image、Javascript)会被生成为单独的文件。--embed 接受字符串作为值。 具体的值必须是 `cCfFiIjJoO` 其中的一个, `cCfFiIjJoO` 对应的是--embed-*** 开关(比如 c 或者 C 就是代表 --embed-css). 其中小写字母代表具体的值为 0,大写代表具体的值为 1。 例如, `--embed cFIJo` 表示除了 CSS 文件和 outlines (大纲) 其他部分都会被嵌入到 HTML 文件中.--split-pages <0|1> (默认值: 0)如果打开的话,每个页面都会被作为一个单独的文件输出。这个开关在你想要动态加载单个 HTML 页面的时候会很有用,这需要服务端的支持(要自己实现单独加载特定页面的逻辑).也可以参考 --page-filename 选项。--dest-dir <dir> (默认值: .)指定输出的目标文件夹(默认是当前文件夹)。--css-filename <filename> (默认值: <none>)指定生成的 CSS 文件(如果使用的不是嵌入的方式的话)的文件名。如果留空的话,对应的文件名会自动生成。--page-filename <filename> (默认值: <none>)Specify the filename template for pages when --split-pages is 1A %d placeholder may be included in `filename` to indicate wherethe page number should be placed. The placeholder supports alimited subset of normal numerical placeholders, including spec‐ified width and zero padding.If `filename` does not contain a placeholder for the page num‐ber, the page number will be inserted directly before the fileextension. If the filename does not have an extension, the pagenumber will be placed at the end of the file name.If --page-filename is not specified, <input-filename> will beused for the output filename, replacing the extension with .pageand adding the page number directly before the extension.Examplespdf2htmlEX --split-pages 1 foo.pdfYields page files foo1.page, foo2.page, etc.pdf2htmlEX --split-pages 1 foo.pdf --page-filename bar.bazYields page files bar1.baz, bar2.baz, etc.pdf2htmlEX --split-pages 1 foo.pdf --page-filename page%dbar.bazYields page files page1bar.baz, page2bar.baz, etc.pdf2htmlEX --split-pages 1 foo.pdf --page-filename bar%03d.bazYields page files bar001.baz, bar002.baz, etc.--outline-filename <filename> (默认值: <none>)Specify the filename of the generated outline file, if notembedded.If it's empty, the file name will be determined automatically.--process-nontext <0|1> (默认值: 1)Whether to process non-text objects (as images)--process-outline <0|1> (默认值: 1)Whether to show outline in the generated HTML--printing <0|1> (默认值: 1)Enable printing support. Disabling this option may reduce thesize of CSS.--fallback <0|1> (默认值: 0)Output in fallback mode, for better accuracy and browser compat‐ibility, but the size becomes larger.--tmp-file-size-limit <limit> (默认值: -1)This limits the total size (in KB) of the temporary files whichwill also limit the total size of the output file. This is anestimate and it will stop after a page, once the total temporaryfiles size is greater than this number.-1 means no limit and is the default.Fonts--embed-external-font <0|1> (默认值: 1)Specify whether the local matched fonts, for fonts not embeddedin PDF, should be embedded into HTML.If this switch is off, only font names are exported such thatweb browsers may try to find proper fonts themselves, and thatmight cause issues about incorrect font metrics.--font-format <format> (默认值: woff)Specify the format of fonts extracted from the PDF file.--decompose-ligature <0|1> (默认值: 0)Decompose ligatures. For example 'fi' -> 'f''i'.--auto-hint <0|1> (默认值: 0)If set to 1, hints will be generated for the fonts using font‐forge.This may be preceded by --external-hint-tool.--external-hint-tool <tool> (默认值: <none>)If specified, the tool will be called in order to enhanced hint‐ing for fonts, this will precede --auto-hint.The tool will be called as '<tool> <in.suffix> <out.suffix>',where suffix will be the same as specified for --font-format.--stretch-narrow-glyph <0|1> (默认值: 0)If set to 1, glyphs narrower than described in PDF will bestretched; otherwise space will be padded to the right of theglyphs--squeeze-wide-glyph <0|1> (默认值: 1)If set to 1, glyphs wider than described in PDF will besqueezed; otherwise it will be truncated.--override-fstype <0|1> (默认值: 0)Clear the fstype bits in TTF/OTF fonts.Turn this on if Internet Explorer complains about 'Permissionmust be Installable' AND you have permission to do so.--process-type3 <0|1> (默认值: 0)If turned on, pdf2htmlEX will try to convert Type 3 fonts suchthat text can be rendered natively in HTML. Otherwise all textwith Type 3 fonts will be rendered as image.This feature is highly experimental.Text--heps <len>, --veps <len> (默认值: 1)Specify the maximum tolerable horizontal/vertical offset (inpixels).pdf2htmlEX would try to optimize the generated HTML file movingText within this distance.--space-threshold <ratio> (默认值: 0.125)pdf2htmlEX would insert a whitespace character ' ' if the dis‐tance between two consecutive letters in the same line is widerthan ratio * font_size.--font-size-multiplier <ratio> (默认值: 4.0)Many web browsers limit the minimum font size, and many wouldround the given font size, which results in incorrect rendering.Specify a ratio greater than 1 would resolve this issue, howeverit might freeze some browsers.For some versions of Firefox, however, there will be a problemwhen the font size is too large, in which case a smaller valueshould be specified here.--space-as-offset <0|1> (默认值: 0)If set to 1, space characters will be treated as offsets, whichallows a better optimization.For PDF files with bad encodings, turning on this option maycause losing characters.--tounicode <-1|0|1> (默认值: 0)A ToUnicode map may be provided for each font in PDF which indi‐cates the 'meaning' of the characters. However often there isbetter "ToUnicode" info in Type 0/1 fonts, and sometimes theToUnicode map provided is wrong. If this value is set to 1, theToUnicode Map is always applied, if provided in PDF, and charac‐ters may not render correctly in HTML if there are collisions.If set to -1, a customized map is used such that rendering willbe correct in HTML (visually the same), but you may not get cor‐rect characters by select & copy & paste.If set to 0, pdf2htmlEX would try its best to balance the twomethods above.--optimize-text <0|1> (默认值: 0)If set to 1, pdf2htmlEX will try to reduce the number of HTMLelements used for text. Turn it off if anything goes wrong.Background Image--bg-format <format> (默认值: png)Specify the background image format. Run `pdf2htmlEX -v` tocheck all supported formats.PDF Protection-o, --owner-password <password>Specify owner password-u, --user-password <password>Specify user password--no-drm <0|1> (默认值: 0)Override document DRM settingsTurn this on only when you have permission.Misc.--clean-tmp <0|1> (默认值: 1)If switched off, intermediate files won't be cleaned in the end.--data-dir <dir> (默认值: /usr/local/share/pdf2htmlEX)Specify the folder holding the manifest and other files (seebelow for the manifest file)`--tmp-dir <dir> (默认值: /tmp)Specify the temporary folder to use for temporary files--css-draw <0|1> (默认值: 0)Experimental and unsupported CSS drawing--debug <0|1> (默认值: 0)Print debug information.Meta-v, --versionPrint copyright and version info--help Print usage informationMANIFEST and DATA-DIRWhen split-pages is 0, the manifest file describes how the final htmlpage should be generated.By default, pdf2htmlEX will use the manifest in the default data-dir(run `pdf2htmlEX -v` to check), which gives a simple demo of its syn‐tax.You can modify the default one, or you can create a new one and specifythe correct data-dir in the command line.All files referred by the manifest must be located in the data-dir.EXAMPLEpdf2htmlEX /path/to/file.pdfConvert file.pdf into file.htmlpdf2htmlEX --clean-tmp 0 --debug 1 /path/to/file.pdfConvert file.pdf and leave all intermediate files.pdf2htmlEX --dest-dir out --embed fi /path/to/file.pdfConvert file.pdf into out/file.html and leave font/image filesseparated.COPYRIGHTCopyright 2012,2013 Lu Wang <coolwanglu@gmail.com>pdf2htmlEX is licensed under GPLv3 with additional terms, read LICENSEfor details.AUTHORpdf2htmlEX is written by Lu Wang <coolwanglu@gmail.com>SEE ALSOHome pagehttps://github.com/pdf2htmlEX/pdf2htmlEXpdf2htmlEX Wikihttps://github.com/pdf2htmlEX/pdf2htmlEX/wikipdf2htmlEX 0.12 pdf2htmlEX(1)
