linux - 使用 PDFtk 删除 pdf 文件的最后一页?

谁能告诉我如何使用 PDFtk 删除 PDF 文件的最后一页?

最佳答案

这将创建 outfile.pdf,其中包含 infile.pdf

中除最后一页之外的所有页面
pdftk infile.pdf cat 1-r2 output outfile.pdf

参数说明

  • infile.pdf是原始pdf文件
  • cat是操作
  • 1-r2 是页面范围
    • You can reference page numbers in reverse order by prefixing them with the letter r. For example, page r1 is the last page of the document, r2 is the next-to-last page of the document, and rend is the first page of the document. You can use this prefix in ranges, too, for example r3-r1 is the last three pages of a PDF.

  • output 会将其输出到特定文件
  • output.pdf是输出的pdf文件

更多示例在这里:https://www.pdflabs.com/docs/pdftk-cli-examples/

https://stackoverflow.com/questions/17705974/

相关文章:

c - malloc 期间内核中发生了什么?

linux - ufw Linux防火墙拒绝和拒绝的区别

ruby-on-rails - 使用上帝监控 unicorn - 以非零代码开始退出 = 1

linux - 使用 iconv 将 UTF-16LE 转换为 UTF-8

linux - 如何在 Linux 上取消关机?

linux - 并行运行 shell 脚本

c - 结构中零长度数组的目的是什么?

c - 与交换空间相关的链接器性能?

c - 使用 LD_PRELOAD 指定多个文件

linux - 从 Linux 命令行写入串行端口