Page 1 of 1

Convert PDF to JPG black backgroun

Posted: 2016-09-11T10:52:48-07:00
by quetzco
Hi,
I'm driving crazy with a very simple conversion.
I need to convert some PDF drawings to JPG in order to embed them into a Crystal Report.
Some drawings are in A3 format so I need to resize them to A4.
My configuration is:
- Windows 10 Pro
- ImageMagick-7.0.3-0-Q16-x64
- gs919w64
I don't need to use too much properties, so my command line is simple like this:
- convert "C:/Temp/B02798800_B.PDF" -resize 842x595^> "C:/Temp/B02798800_B.JPG"
Using exact pixel dimensions or percentage doesn't change the final result: a total black background.
If I use -page A4 property it works.
I'd prefer to use -resize because with the ^> extension, it could be avoided an unnecessary resizing (drawing smaller thn A4 format).
It seems that the problem is related only to the -resize property.

Thanks in advance for any help.

Antonio

Re: Convert PDF to JPG black backgroun

Posted: 2016-09-11T11:02:47-07:00
by snibgo
Your PDF probably has a transparent backgound. JPG can't store transparency. What colour do you want the background to be? Perhaps white:

Code: Select all

convert "C:/Temp/B02798800_B.PDF" -background White -layers flatten -resize 842x595^> "C:/Temp/B02798800_B.JPG"

Re: Convert PDF to JPG black backgroun

Posted: 2016-09-11T11:10:10-07:00
by quetzco
Great!
I've tried it immediately and it works.
Thank you

Antonio