poppler-utils是建立在Poppler的库API上的工具集合,用于管理PDF和提取内容。
以下为工具列表:
pdfdetach – 从PDF中提取嵌入式文档;
pdffonts – 列出PDF中使用的字体;
pdfimages – 从PDF中以原始分辨率提取所有嵌入式图像;
pdfinfo – 列出PDF的所有信息;
pdfseparate – 从PDF中提取单个页面;
pdftocairo – 使用cairo将单页从PDF转换为矢量或位图格式;
pdftohtml – 将PDF转换为HTML格式的保留格式;
pdftoppm – 将PDF页面转换为位图;
pdftops – 将PDF转换为可打印的PS格式;
pdftotext – 从PDF中提取所有文本;
pdfunite – 合并几个PDF。
安装方式,CentOS为例:sudo yum install poppler-utils.x86_64
pdftohtml使用实例:
安装完成,使用命令 pdftohtml -c -s document.pdf 即可
详细命令如下
[root@localhost ~]# pdftohtml --help
pdftohtml version 0.26.5
Copyright 2005-2014 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1999-2003 Gueorgui Ovtcharov and Rainer Dorsch
Copyright 1996-2011 Glyph & Cog, LLC
Usage: pdftohtml [options] <PDF-file> [<html-file> <xml-file>]
-f <int> : first page to convert
-l <int> : last page to convert
-q : don't print any messages or errors
-h : print usage information
-? : print usage information
-help : print usage information
--help : print usage information
-p : exchange .pdf links by .html
-c : generate complex document
-s : generate single document that includes all pages
-i : ignore images
-noframes : generate no frames
-stdout : use standard output
-zoom <fp> : zoom the pdf document (default 1.5)
-xml : output for XML post-processing
-hidden : output hidden text
-nomerge : do not merge paragraphs
-enc <string> : output text encoding name
-fmt <string> : image file format for Splash output (png or jpg)
-v : print copyright and version info
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-nodrm : override document DRM settings
-wbt <fp> : word break threshold (default 10 percent)
-fontfullname : outputs font full name