Page 1 of 1

crop multi-page pdf and merge 2 pages into 1

Posted: 2011-04-20T00:11:12-07:00
by dre12b
My goal is to (a) crop the bottom half of each page in a multi-page pdf (b) merge two pages so that the top half of page 1 is now followed by the top half of page 2 in the new document. If necessary I can use pdftk to burst the multi-page pdf into single pages, do the cropping, and then merge them back together.

Any pointers?

I'm using imagemagick 6.6.2-6 from the command-line on a linux ubuntu machine.

Re: crop multi-page pdf and merge 2 pages into 1

Posted: 2011-04-20T09:47:28-07:00
by fmw42
convert -density XX% image.pdf[0,1] +adjoin -gravity north -crop 50%x50%+0+0 +repage -append resultimage.

However, if your resultimage is pdf, then IM is not a very good tool to use as it goes from vector to raster to vector again. See http://www.imagemagick.org/Usage/formats/#vector

Re: crop multi-page pdf and merge 2 pages into 1

Posted: 2011-04-20T10:00:43-07:00
by dre12b
This is excellent. Many thanks! I've got to do some tinkering to dial in the setting, but it should work well for printing.

What is the (0,1)? Does that specify the pages to work with?

Re: crop multi-page pdf and merge 2 pages into 1

Posted: 2011-04-20T12:40:20-07:00
by fmw42
dre12b wrote:This is excellent. Many thanks! I've got to do some tinkering to dial in the setting, but it should work well for printing.

What is the (0,1)? Does that specify the pages to work with?
[0,1] is the list of frames/pages (or image sequence numbers) selected to use from the PDF. In this case, only those two will be processed. Be sure you square brackets. see selecting frames at http://www.imagemagick.org/script/comma ... essing.php or image sequences at http://www.imagemagick.org/Usage/basics/#image_seq

Re: crop multi-page pdf and merge 2 pages into 1

Posted: 2011-04-20T16:53:56-07:00
by anthony