Create png from only first page of pdf file

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
User avatar
michelle
Posts: 31
Joined: 2011-08-24T06:45:50-07:00
Authentication code: 8675308

Create png from only first page of pdf file

Post by michelle »

Hi there, I am using the below command to create png images from pdf documents. I am only ever interested in the first page of the pdf document. That is, I only ever want a png of the first page of any pdf document. In my collection of pdf documents the number of pages range from 1 onwards. Is there a way to modify the below command to include saying "only convert the first page into a png, ignore the rest" ?

convert -density 300 input.pdf -scale 400000 output.png

Thank-you in advance, Michelle
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Create png from only first page of pdf file

Post by Bonzo »

Try:

Code: Select all

convert -density 300 input.pdf[0] -scale 400000 output.png
I think that the count starts from 0 and not 1
User avatar
michelle
Posts: 31
Joined: 2011-08-24T06:45:50-07:00
Authentication code: 8675308

Re: Create png from only first page of pdf file

Post by michelle »

great. thank-you. it works perfectly. :)
Post Reply