在不同的Linux分发版本中使用poppler-utils包安装pdftotext(CentOS):
# yum install poppler-utils
或者在Debian / Ubuntu中使用如下指令:
$ sudo apt-get install poppler-utilspdftotext 使用语法
pdftotext {PDF-file} {text-file}如何将pdf转化为text?
将php-manual.pdf 转化为 php-manual.txt:
$ 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
Sets the end-of-line convention to use for text output. You can set it to unix, dos or mac. For UNIX / Linux oses, enter:
$ pdftotext -eol unix php-manual.pdf php-manual.txt更多命令:man page pdftotext
此外,还可以转化pdf为多种其他格式文件:
如可以将pdf文件转化为html,但我测试了一下,效果貌似不佳,很多页面有错乱出现,但是pdftotext转化的效果还是不错的(图片都去掉了),而且速度很快。
相关文章:
1. Win11磁盘分区出现defrag事件的原因及解决教程2. Win11定位功能怎么打开?Win11系统开启定位功能操作方法3. Win11无法打印彩色文档怎么办? win11无法打印彩色文档解决方法4. Win11 双击文件夹弹出属性怎么办?Win11双击文件夹弹出属性解决方法5. win最稳定的版本推荐6. Win11怎么退回Win10系统?Win11重装Win10图文教程7. Win11右键没有压缩选项怎么办?Win11右键没有压缩选项的解决方法8. Win11摄像头禁用了怎么办?Win11系统禁用摄像头无法使用解决方法9. Win11天气预报定位错误怎么回事?Win11天气预报定位不对解决方法10. Win11右下角弹出英特尔无线bluetooth的解决教程