title: Combine multi-page PDFs into one PDF with ImageMagick
body: <p>I am trying to use ImageMagick (6.8.0) to combine several multi-page PDFs into a single PDF. This command:</p>
  
  <pre><code>$ convert multi-page-1.pdf multi-page-2.pdf merged.pdf
  </code></pre>
  
  <p>Returns merged.pdf, which contains the <strong>first</strong> page of multi-page-1.pdf and the <strong>first</strong> page of multi-page-2.pdf.</p>
  
  <p>This command:</p>
  
  <pre><code>$ convert multi-page-1.pdf[2] multi-page-2.pdf[2] merged.pdf
  </code></pre>
  
  <p>Returns merged.pdf, which contains the <strong>third</strong> page of multi-page-1.pdf and the <strong>third</strong> page of multi-page--2.pdf.</p>
  
  <p>I would like to merged.pdf to contain all of the pages of each multi-page pdf. I have so far not found a way of telling the convert command to use a range of pages, although I have tried adding [0-1] and [0,1] at the end of the filenames.</p>
  
  <p>Interestingly, this ghostscript command (which I found via StackOverflow but cannot re-find) does work as I would like it to:</p>
  
  <pre><code>$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf multi-page-1.pdf multi-page-2.pdf 
  </code></pre>
  
  <p>The problem is, the ImageMagick 'convert' command takes urls as inputs and ghostscript does not, and I need my program to take url input rather than file paths. </p>
  
  <p><strong>Is it possible to get the result of the above ghostscript command using ImageMagick?</strong></p>