从一系列 PDF 中删除第一页

发布于 2024-09-27 09:25:08 字数 377 浏览 0 评论 0原文

我有一系列 PDF(计算机游戏世界问题 )并且我想从每期的 pdf 文件中删除第一页。有 100 个问题,所以 GUI 是无法解决问题的。我使用 pdftk 删除了一个问题的第一页:

pdftk 1981_1112_issue1.pdf cat 1 output 1.pdf

我的问题是我不想为每个 pdf 问题修改并运行此命令,因为这并不比 GUI 方法好多少。

使用 *.pdf 作为输入似乎不起作用。我还可以使用哪些其他方法在每个 PDF 上运行 pdftk?

I have a series of PDFs (Computer Gaming World issues) and I want to remove the first page from the pdf file of each issue. There are 100 issues, so a GUI is just not gonna cut it. I used pdftk to remove the first page from one issue:

pdftk 1981_1112_issue1.pdf cat 1 output 1.pdf

My problem is that I do not want to have to modify and run this command for every pdf issue as that is not much better than the GUI method.

Using *.pdf as an input does not seem to work. What other ways can I use to run pdftk on every PDF?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沫尐诺 2024-10-04 09:25:08

循环讨论所有问题。输出以问题命名,将“问题”替换为“输出”。第一行提取第1页,第二行提取其他页面:

for issue in *_issue*.pdf
do
    pdftk ${issue} cat 1 output page1_${issue/issue/output}
    pdftk ${issue} cat 2-end output otherpages_${issue/issue/output}
done

Loop on all issues. Output is named after issue by replacing "issue" by "output". The first line extract page 1, the second line extract the other pages:

for issue in *_issue*.pdf
do
    pdftk ${issue} cat 1 output page1_${issue/issue/output}
    pdftk ${issue} cat 2-end output otherpages_${issue/issue/output}
done
深巷少女 2024-10-04 09:25:08
shopt -s nullglob
for file in *.pdf
do
 out=${file%.pdf}_page1.pdf
 pdftk "$file" cat 1 output "$out"
done
shopt -s nullglob
for file in *.pdf
do
 out=${file%.pdf}_page1.pdf
 pdftk "$file" cat 1 output "$out"
done
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文