Page 1 of 1

convert first page of pdf to jpg

Posted: 2011-10-16T13:23:20-07:00
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 .

Re: convert first page of pdf to jpg

Posted: 2011-10-16T14:22:25-07:00
by eyalb
i found the answer

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