conversion for .pdf to another format, Ghostscript

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
coulon

conversion for .pdf to another format, Ghostscript

Post by coulon »

I'am converting from .pdf to .jpg, .png etc.(doesn't matter). On one computer it's OK, on the other one I obtain horizontal black lines at random heights.

AFAIK Imagemagick "delegates" the conversion to Ghostscript when the input is .pdf.

With the bad computer I have two versions of Ghostscript installed. How can I know to which version Imagemagick delegates? How can I force "delegating" to either Ghostscript version? The most recent isn't always the best! The -verbose option gives this crap:

[ghostscript library] -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dFirstPage=3 -dLastPage=3 "-sOutputFile=C:/DOCUME~1/coulon/LOCALS~1/Temp/magick-kvoGqIvL" "-fC:/DOCUME~1/coulon/LOCALS~1/Temp/magick-By81XudK" "-fC:/DOCUME~1/coulon/LOCALS~1/Temp/magick-W9PDxY0L"C:/DOCUME~1/coulon/LOCALS~1/Temp/magick-kvoGqIvL PNM 540x760 540x760+0+0 1-bit Bilevel DirectClass 50.5kb
source.pdf[2]=>source.pdf PDF 540x760 540x760+0+0 16-bit Bilevel DirectClass 50.5kb
source.pdf[2]=>essai.jpg PDF 540x760 540x760+0+0 16-bit Bilevel DirectClass 146kb 0.031u 0:01
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: conversion for .pdf to another format, Ghostscript

Post by anthony »

The "delegate.xml" fiel either gives the delegate as a full path, OR uses the current PATH environment variable.
Depends on how it was installed.

Modify the delegate configuration file if you need to.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
coulon

Re: conversion for .pdf to another format, Ghostscript

Post by coulon »

the PATH command gives no path to Ghostcript, and delegate.xml contains this line:

<delegate decode="pdf" encode="ps" mode="bi" command=""@PSDelegate@" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 -sDEVICE=pswrite "-sOutputFile=%o" -- "%i""/>

How can I modify the equivalent of PSDelegate?

convert -list delegate displays this: pdf<=>eps "C:/gs/gs8.14/bin/gswin32c.exe"
but this gs8.14 is not present in delegate.xml. Is it in another configuration file?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: conversion for .pdf to another format, Ghostscript

Post by anthony »

That looks like the source code delegates file, not the installed one.

Mine has...

Code: Select all

<delegate decode="pdf" encode="ps" mode="bi" command=""gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pswrite" "-sOutputFile=%o" "-f%i""/>
which means the command is just "gs" so Im will find it on the current PATH environment variable.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply