Page 1 of 1
PDF to JPG not picking up all layers
Posted: 2012-05-08T09:05:08-07:00
by image007
Problem: When I convert a PDF to a JPG, it doesn't seem to be picking up all of the layers for some PDFs. The background and text all appear black, while the images in the PDF appear in the JPG no problem.
- convert.exe is called directly from another program so it's command line parameters can't be changed. I've found that the "-flatten" parameter seems to fix this issue.
My question is: Is there any way to add a delegate that says "use -flatten" when converting PDF to JPG?
Thanks!
Re: PDF to JPG not picking up all layers
Posted: 2012-05-08T10:12:43-07:00
by image007
I found my answer!
in delegates.xml I changed this line:
<delegate decode="ps:alpha" restrain="True" command=""@PSDelegate@" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
To:
<delegate decode="ps:alpha" restrain="True" command=""@PSDelegate@" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>
Now, there's no need to use -flatten or -layers merge PDFs convert to JPGs without background or alpha layer issues!
Re: PDF to JPG not picking up all layers
Posted: 2012-05-10T16:31:59-07:00
by anthony
I believe you get the same effect with some of the specific settings.
But really if you are serious about translating from Postscript, you can use Ghostscript yourself, rather than trying to use the IM convenience function.
http://www.imagemagick.org/Usage/text/text/#ghostscript