3

Is it possible to merge several PDF's into one PDF document in Matlab while controlling the sequence in which the PDF's are merged?

Example:

I have a folder with PDF's:

docu1.pdf
docu2.pdf
docu3.pdf
docu4.pdf

I want to merge them to one PDF document with the following page mapping:

page 1: docu3.pdf
page 2: docu4.pdf
page 3: docu2.pdf
page 4: docu1.pdf

The above order is just an example, I want to be able to control the sequence in the script.

4

1 回答 1

5

您可以使用 ghostscript 在命令行中合并您的 PDF 文件,也可以使用系统操作符从 Matlab 调用命令行。

将两者结合起来,您可以:

command = 'gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf';
[status,cmdout] = system(command)
于 2013-05-01T16:47:52.617 回答