I am trying to use ImageMagick (6.8.0) to combine several multi-page PDF files into one PDF file. This command:
$ convert multi-page-1.pdf multi-page-2.pdf merged.pdf
Returns merged.pdf that contains the first page page with multiple pages 1.pdf and the first page with multiple pages 2.pdf. p>
This command:
$ convert multi-page-1.pdf[2] multi-page-2.pdf[2] merged.pdf
Returns a merged.pdf file containing a third page page with multiple pages 1.pdf and a third page with multiple pages 2.pdf.
I would like to combine .pdf to contain all the pages of each multi-page pdf. I still have not found a way to tell the convert command to use a range of pages, although I tried to add [0-1] and [0,1] at the end of the file names.
Interestingly, this ghostscript command (which I found through StackOverflow but cannot find) works the way I would like:
$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf multi-page-1.pdf multi-page-2.pdf
The problem is that the ImageMagick 'convert' command accepts URLs as input, but ghostscript does not, and I need my program to enter the url, not file paths.
Is it possible to get the result of the above ghostscript command using ImageMagick?
source share