convert first page of pdf to jpg

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
eyalb
Posts: 2
Joined: 2011-10-16T13:16:31-07:00
Authentication code: 8675308

convert first page of pdf to jpg

Post by eyalb »

i have some pdf files and i want to convert first page into jpg

i use

Code: Select all

convert -trim c:\temp\2011-10-16.pdf[0] c:\temp\2011-10-16.jpg
and it's work fine

now i want to do it for all the pdf in a directory or in a txt file

i tried

Code: Select all

convert -trim c:\temp\@1.txt c:\temp\1.jpg
but it's not working
edited:
i tried

Code: Select all

convert -trim c:\temp\*.pdf[0] c:\temp\%1.jpg
now it's working but i cant get the output filename correct.



i work on windows xp .
eyalb
Posts: 2
Joined: 2011-10-16T13:16:31-07:00
Authentication code: 8675308

Re: convert first page of pdf to jpg

Post by eyalb »

i found the answer

FOR /R C:\Directory %F in (*.*) do convert -trim %~nFxF[0] %~nFxF.jpg
Post Reply