convert is a member of the
ImageMagick software suite for image manipulation.
Two of my earlier posts dealt with using
convert to slice and
resize an image.
It is a lesser-known fact that
convert also works with
In this post, I'll illustrate how to do the same using the
First, you need to install
convert which is packaged in the
$ sudo apt-get install imagemagick
file2) into a new file (
output) is as simple as executing:
$ convert file1.pdf file2.pdf output.pdf
You can merge a subset of pages instead of the entire input files.
To accomplish that, use the angle brackets to specify the target subset of pages.
For example, to merge page 1 of
file1 with pages 1, 2 and 4 of
run the following command:
$ convert file1.pdf file2.pdf[0-1,3] output.pdf
Note that page numbers are zero-based. Therefore,  is page 1, and [0-1] are the pages ranging from page 1 to page 2.
Finally, the following example splits up
input into 2 files:
The former output file contains pages 1 and 2 from the original file; the latter, pages 3 and 4.
$ convert input.pdf[0-1] first2output.pdf
$ convert input.pdf[2-3] next2output.pdf
As you can see,
convert is a versatile utility program to manipulate both image and pdf files.