How to convert PDF to PNG and cut each page to half?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
rondesta
Posts: 2
Joined: 2011-02-20T01:52:31-07:00
Authentication code: 8675308

How to convert PDF to PNG and cut each page to half?

Post by rondesta »

Hi,

I'm trying to convert a PDF file. The file is a presentation that each page contains 2 slides.
I want to convert it in way that I'll get PNG for every slide (not page).

I tried:

Code: Select all

convert file.pdf file.png
but it creates a PNG for every page.
I assume that I need to use one of the functions to cut each page to half (relatively to the height) but I don't know which one.

Thanks,

Ron.
rondesta
Posts: 2
Joined: 2011-02-20T01:52:31-07:00
Authentication code: 8675308

Re: How to convert PDF to PNG and cut each page to half?[SOL

Post by rondesta »

I figured it out:

Code: Select all

convert -crop widthXheight file.pdf file.png
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to convert PDF to PNG and cut each page to half?

Post by anthony »

Try -crop 2x1@ instead That will not need you to pre-calculate the size, but divide the image in two as equally as possible.

http://www.imagemagick.org/Usage/crop/#crop_equal

There are also options to add some overlap to the two halves :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply