Page 1 of 1

simple pdf to jpg

Posted: 2011-11-21T11:21:41-07:00
by alfredopacino
hi, sorry for my poor english

i wanna simply convert my pdf first pages in jpg (resized 50%)
this is the code:
convert abc.pdf[0] -resize 50% abc.jpg

all works, but in this way i see black background (and a black border around my page too) and i can't see the black text in the jpg!
how can i set white background and no border?

Re: simple pdf to jpg

Posted: 2011-11-21T11:57:53-07:00
by fmw42
you probably need to post a link to your pdf file so others can see what is happening. Also what version of IM are you using and on what platform.

Re: simple pdf to jpg

Posted: 2011-11-21T14:56:03-07:00
by alfredopacino
sorry :) the version is the last one 6.7.3 (on windows 7 x64), i working in local

Code: Select all

convert apportoproteico.pdf[0] -resize 50% apportoproteico.jpg
Image

http://www.nabbaitalia.it/imagemagick/a ... oteico.pdf

Re: simple pdf to jpg

Posted: 2011-11-21T15:06:21-07:00
by fmw42
You have a file that does not conform to Adobe's standard. When I run the following I get the following error messages, though an image is produced. However, as you say it is black and the text cannot be read.


convert -density 288 apportoproteico.pdf[0] -resize 25% apportoproteico.jpg
**** Warning: xref subsection header has extra characters.
**** Warning: An error occurred while reading an XREF table.
**** The file has been damaged. This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.

**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> Microsoft? Office Word 2007 <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.



Apparently, Ghostscript, which IM uses for PDF files, cannot properly correct the pdf file.

Re: simple pdf to jpg

Posted: 2011-11-21T15:26:11-07:00
by alfredopacino
yep you're right :(
i opened that pdf in photoshop and save the first page, the script works fine.

But i can't do this for all my documents, there's too much.
I remember an old version of imagemagick works on these file (in this thread i worked with same files).

Re: simple pdf to jpg

Posted: 2011-11-21T15:40:07-07:00
by fmw42
This seems to work even though I still get those error messages.


convert apportoproteico.pdf[0] PDF:- | convert - apportoproteico.jpg

Re: simple pdf to jpg

Posted: 2011-11-21T18:08:36-07:00
by alfredopacino
thanks a lot, but i read too late :D
i just finished to resize 80 documents in photoshop (40 batch with the actions and 40 password protected (no copy) with a window screenshot!) :shock:

bye and thanks again