I have the following:
ghostscript-fonts-5.50-24 ImageMagick-6.7.2-1 ghostscript-9.02-1
Which I use to create a series of JPGs for each page using:
convert -density 175 -colorspace sRGB test.pdf -resize 50% -quality 95 test.jpg
When I run this on my windows machine all appears to work ok, but on our linux server we get the black background problem.
The resulting JPGs have a black background rendering the image un-readable, what am I missing or is there something I should be doing to correct this?
I've been all over google for days but each suggestion doesnt seem to work for me.
Any help is much appreciated, thanks in advance :)
EDIT
Just noticed this output when converting one of the PDFs that produces the black background:
**** Warning: Fonts with Subtype = /TrueType should be embedded. The following fonts were not embedded: Arial Arial,Bold Arial,BoldItalic **** This file had errors that were repaired or ignored. **** The file was produced by: **** >>>> Microsoft« Word 2010 <<<< **** Please notify the author of the software that produced this **** file that it does not conform to Adobe's published PDF **** specification.
This seems related but as we don't have control over how the PDFs are produced we need some way of fixing this server side.
Thanks again
Hi, This behavior is by design. Transparency is disabled on purpose for PDF/A because we support PDF/A-1, which does not allow transparency. Thanks!
So if you have a vector PDF and you convert it to PDF using ImageMagick, it will rasterize the PDF to pixels (not vectors) and imbed the raster image in a vector PDF shell. That will make the output much larger than the input.
Ran into this one today, found this:
https://www.imagemagick.org/discourse-server/viewtopic.php?t=20234
Based on that, these should all work:
-flatten
-alpha flatten
-alpha remove
I'm currently using the below for my specific case which works great:
convert -thumbnail "1280x800>" -density 300 -background white -alpha remove in.pdf out.jpg
Simple fix to this issue is to use an image format that supports transparency, such as png.
So:
convert -density 175 -colorspace sRGB test.pdf -resize 50% -quality 95 test.png
Problem solved :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With