我想解析一个pdf文件,因为我正在使用pdftotext
实用程序将pdf文件转换为文本文件,现在我想从文本文件中删除页码、页眉和页脚。
我正在使用以下语法转换 pdf 文件:
pdftotext -layout input.pdf output.txt
谁能帮我解决这个问题吗?
最佳答案
您需要使用参数 -H -W -y -x 进行裁剪,至少为 -H -W -y。
示例:
pdftotext -y 80 -H 650 -W 1000 -nopgbrk -eol unix example.pdf
-y 80 -> crop 80 pixels after the top of file (remove header);
-H 650 -> crop 650 pixels after the -y has cropped (remove footer);
-W 1000 -> hight value to crop nothing (need especify something);
您需要针对每个 PDF 调整 -y 和 -H,有时减少 -y 并增加 -H 以适应页眉和页脚;
关于pdftotext - 从 pdf 文件中删除页码、页眉和页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27901194/