如何拼接pdf文档?

sh/bash/dash/ksh/zsh等Shell脚本
回复
罗非鱼
帖子: 980
注册时间: 2008-04-12 12:44

如何拼接pdf文档?

#1

帖子 罗非鱼 » 2010-06-04 8:28

可否用命令行来拼接pdf文档?
cat ~/test/001.PDF >> ~/test/total.pdf
cat ~/test/002.PDF >> ~/test/total.pdf
拼完后, ~/test/total.pdf中只有 ~/test/002.PDF
反复测试多次都是这样。
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

Re: 如何拼接pdf文档?

#2

帖子 BigSnake.NET » 2010-06-04 8:44

不可以
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 如何拼接pdf文档?

#3

帖子 eexpress » 2010-06-04 12:26

可以用pdftk拼。也是cli啊。
lol
● 鸣学
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30

Re: 如何拼接pdf文档?

#4

帖子 aerofox » 2010-06-04 12:56

如果不用考虑书签,那么 pdftk 是最好的选择。
罗非鱼
帖子: 980
注册时间: 2008-04-12 12:44

Re: 如何拼接pdf文档?

#5

帖子 罗非鱼 » 2010-06-05 12:23

The commandline utilities, Ghostscript and PDFtk, will do what you want.

Code:

gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=[output file] [input files]

or

Code:

pdftk [input files] cat output [output file]

In the above commands, you need to insert the names of the input and output files. When combining a large number of PDF files, it may be easiest to place them in an empty directory and use *.pdf as the input files.
回复