Page 1 of 1

ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-27T02:38:06-07:00
by triumvir
Hi,

there is a problem if I convert from ps (eps) to pdf.
At the version 6.4.2 it works well. The pdf is well and I am able to mark text in it.
With the version 6.7.3-2 the conversion works too, but the result is a bitmap pdf. The size of the file is for the factor 10 bigger.
Version 6.4.2:

Code: Select all

convert -verbose 00976451.eps.ps test.pdf

"gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g128x142  "-sOutputFile=/tmp/magick-XXI7ZoFn" "-f/tmp/magick-XXD8ZMaF" "-f/tmp/magick-XXLJKlGW"
/tmp/magick-XXI7ZoFn PNM 128x142 128x142+0+0 8-bit ColorSeparation DirectClass 71.1kb
00976451.eps.ps PS 128x142 128x142+0+0 16-bit ColorSeparation DirectClass 71.1kb
"gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pdfwrite" "-sOutputFile=/tmp/magick-XXBROoY6" "-f/tmp/magick-XXTwlvTi"


Version 6.7.3-2:

Code: Select all

convert -verbose -format pdf 00976451.eps.ps test.pdf

"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g128x142  "-sOutputFile=/tmp/magick-M9IGiCcL-%08d" "-f/tmp/magick-8vmo9Cu4" "-f/tmp/magick-tKSJsJMn"
/tmp/magick-M9IGiCcL-00000001 PAM 128x142 128x142+0+0 8-bit ColorSeparation DirectClass 72.8KB 0.000u 0:00.000
00976451.eps.ps PS 128x142 128x142+0+0 16-bit ColorSeparation DirectClass 72.8KB 0.000u 0:00.000
00976451.eps.ps=>test.pdf PS 128x142 128x142+0+0 16-bit ColorSeparation DirectClass 86.6KB 0.000u 0:00.010         


At the version 6.7.3 the second step is missing (gs ...-sDEVICE=pdfwrite ...).

Is there a mistake by me ??

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-27T20:24:59-07:00
by anthony
It looks like the delegates are attempting to 'short-circuit' as you don't modify the image in memory.

Add a -taint between the read of the PS and the write of the PDF.

See IM Examples, File Handling, Delegates for more detail.
http://www.imagemagick.org/Usage/files/#delegate_direct

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-27T23:56:01-07:00
by triumvir
anthony wrote:It looks like the delegates are attempting to 'short-circuit' as you don't modify the image in memory.

Add a -taint between the read of the PS and the write of the PDF.

See IM Examples, File Handling, Delegates for more detail.
http://www.imagemagick.org/Usage/files/#delegate_direct
No change:

Code: Select all

convert -verbose 00976451.eps.ps -taint pdf:test.pdf
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g128x142  "-sOutputFile=/tmp/magick-h0HZ3vA2-%08d" "-f/tmp/magick-CBWolTSC" "-f/tmp/magick-nv9u2lbd"
/tmp/magick-h0HZ3vA2-00000001 PAM 128x142 128x142+0+0 8-bit ColorSeparation DirectClass 72.8KB 0.000u 0:00.000
00976451.eps.ps PS 128x142 128x142+0+0 16-bit ColorSeparation DirectClass 72.8KB 0.000u 0:00.000
00976451.eps.ps=>test.pdf PS 128x142 128x142+0+0 16-bit ColorSeparation DirectClass 86.6KB 0.000u 0:00.009                          

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-28T06:03:26-07:00
by magick
Try this command:
  • convert -verbose 00976451.eps.ps -define delegate:bimodal=true test.pdf
Bimodal delegate support is seldom used and it was affecting performance so we made it an option.

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-28T06:19:14-07:00
by triumvir
magick wrote:Try this command:
  • convert -verbose 00976451.eps.ps -define delegate:bimodal=true test.pdf
Bimodal delegate support is seldom used and it was affecting performance so we made it an option.
It works. This is the right moment to go into the weekend :D
Thanks a lot

P.S Where can I find some documentation about the Option bimodal

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-28T09:17:54-07:00
by magick
See the PDF format @ http://www.imagemagick.org/script/formats.php. It simply says: To specify direct conversion from Postscript to PDF, use -define delegate:bimodel=true.

Re: ps -> pdf v6.4.2 OK,6.7.3-2 FAILED

Posted: 2011-10-29T20:55:00-07:00
by anthony
Sounds to me that this bimodel is better done simply by forgetting IM enterirely have just using ghostscript directly.

triumir Can you give the actual delegate command that the bimodel delegate generations in your example.