在不同的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 Build 25295预览版更新(附更新修复内容汇总)2. 电脑蓝屏代码0x000000d1怎么办?0x000000d1电脑蓝屏代码解决方法3. Win11 Dev 预览版Build 25300发布更新(附完整更新日志) 4. Win10 22H2(19045.2670)更新补丁KB5022906发布(附更新修复内容汇总)5. win最稳定的版本推荐6. Win11加密功能怎么添加到右键菜单? Win11加密解密右键快捷添加方法7. 你没有权限在此位置中保存文件请与管理员联系以或得相应权限8. Win11提示音怎么关闭?Win11系统开机提示音关闭方法9. Win10应用搜索功能不能用怎么办? Win10搜索索引失效的解决办法10. Win11无法打印彩色文档怎么办? win11无法打印彩色文档解决方法