
安装 pdftotext 到 RedHat / RHEL / Fedora / CentOS / Ubuntu
# yum install poppler-utils

pdftotext 使用语法
# pdftotext {PDF-file} {text-file} # pdftotext php-manual.pdf php-manual.txt //只转化前 5 页和后 10 页: $ pdftotext -f 5 -l 10 php-manual.pdf php-manual.txt //转化加密过的pdf文件( owner password ): $ pdftotext -opw 'password' php-manual.pdf php-manual.txt //转化加密过的pdf文件( user password ): $ pdftotext -upw 'password' php-manual.pdf php-manual.txt //设置用于文本输出的行尾约定。您可以将其设置为unix、dos或mac。对于unix / Linux操作系统,请输入: $ pdftotext -eol unix php-manual.pdf php-manual.txt