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

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
triumvir
Posts: 3
Joined: 2011-10-27T02:15:42-07:00
Authentication code: 8675308

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

Post 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 ??
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
triumvir
Posts: 3
Joined: 2011-10-27T02:15:42-07:00
Authentication code: 8675308

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

Post 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                          
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
triumvir
Posts: 3
Joined: 2011-10-27T02:15:42-07:00
Authentication code: 8675308

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply