simple 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
alfredopacino
Posts: 14
Joined: 2011-01-28T06:58:45-07:00
Authentication code: 8675308

simple pdf to jpg

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: simple pdf to jpg

Post 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.
alfredopacino
Posts: 14
Joined: 2011-01-28T06:58:45-07:00
Authentication code: 8675308

Re: simple pdf to jpg

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: simple pdf to jpg

Post 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.
alfredopacino
Posts: 14
Joined: 2011-01-28T06:58:45-07:00
Authentication code: 8675308

Re: simple pdf to jpg

Post 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).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: simple pdf to jpg

Post by fmw42 »

This seems to work even though I still get those error messages.


convert apportoproteico.pdf[0] PDF:- | convert - apportoproteico.jpg
alfredopacino
Posts: 14
Joined: 2011-01-28T06:58:45-07:00
Authentication code: 8675308

Re: simple pdf to jpg

Post 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
Post Reply