首页 > 解决方案 > 将 PDF 与文件名中的空格结合起来

问题描述

我有一个目录,其中包含许多文件名中有空格的 PDF。

file 1.pdf
file 2.pdf
file 3.pdf
# And so on

我在那个目录中运行了这个命令。

pdftk `ls -v` cat output combined-report.pdf

但是终端吐出一堆这样的错误。

Error: Unable to find file.
Error: Failed to open PDF file: 
   file
Error: Unable to find file.
Error: Failed to open PDF file: 
   1.pdf

如何pdftk在 Arch Linux 中使用或任何其他包组合 PDF?为了澄清,我想按打印的顺序组合文件ls -v

标签: linuxunixpdfpdftk

解决方案


只需在创建组合 pdf 时使用通配符,例如:

pdftk *.pdf cat output newfile.pdf

或者你可以使用这样的东西:

pdftk file\ 1.pdf file\ 2.pdf cat output newfile.pdf


推荐阅读