comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cgwindow unable to create PDF file in IDL 8.3
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cgwindow unable to create PDF file in IDL 8.3 [message #88152] Tue, 25 March 2014 03:09 Go to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Hi,

We recently upgraded to IDL version 8.3 (from version 7.1) and now my cgwindows do not seem to be able to create PDF files. When I try a window pops up with an error message: "CGCMDWINDOW::AUTORASTERFILE: Unable to create PDF file. See cgPS2PDF documentation."

A test session:

IDL> cgwindow
IDL> cgplot,[1,2],/add
IDL> cgcontrol,output='test.pdf'


I looked at https://www.idlcoyote.com/idldoc/cg/cgps2pdf.html without finding anything obvious.

I have updated the Coyote library today. PDF file creation still works in idl version 7.1.

My environment is Debian 3.12 x86_64 GNU/Linux.
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88154 is a reply to message #88152] Tue, 25 March 2014 05:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> We recently upgraded to IDL version 8.3 (from version 7.1) and now my cgwindows do not seem to be able to create PDF files. When I try a window pops up with an error message: "CGCMDWINDOW::AUTORASTERFILE: Unable to create PDF file. See cgPS2PDF documentation."
>
> A test session:
>
> IDL> cgwindow
> IDL> cgplot,[1,2],/add
> IDL> cgcontrol,output='test.pdf'
>
>
> I looked at https://www.idlcoyote.com/idldoc/cg/cgps2pdf.html without finding anything obvious.
>
> I have updated the Coyote library today. PDF file creation still works in idl version 7.1.
>
> My environment is Debian 3.12 x86_64 GNU/Linux.

Well, these commands still work in my IDL 8.2.3. I would start by making
something simpler.

cgps_open, 'test.ps'
plot, indgen(11)
cgps_close

Now, can you create a PDF file?

cgps2pdf, 'test.ps', /showcmd

If not, why not? You might have to step though the code. The program
uses GhostScript to do the conversion, by default. Has that moved
or been installed in a non-standard place. Can the gs command be found?

The command above will show you the command it is trying to execute. Can
you execute that command from a Unix prompt?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88155 is a reply to message #88154] Tue, 25 March 2014 05:30 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Mats Löfdahl writes:
>
>> We recently upgraded to IDL version 8.3 (from version 7.1) and now my cgwindows do not seem to be able to create PDF files. When I try a window pops up with an error message: "CGCMDWINDOW::AUTORASTERFILE: Unable to create PDF file. See cgPS2PDF documentation."
>>
>> A test session:
>>
>> IDL> cgwindow
>> IDL> cgplot,[1,2],/add
>> IDL> cgcontrol,output='test.pdf'
>>
>>
>> I looked at https://www.idlcoyote.com/idldoc/cg/cgps2pdf.html without finding anything obvious.
>>
>> I have updated the Coyote library today. PDF file creation still works in idl version 7.1.
>>
>> My environment is Debian 3.12 x86_64 GNU/Linux.
>
> Well, these commands still work in my IDL 8.2.3. I would start by making
> something simpler.
>
> cgps_open, 'test.ps'
> plot, indgen(11)
> cgps_close
>
> Now, can you create a PDF file?
>
> cgps2pdf, 'test.ps', /showcmd
>
> If not, why not? You might have to step though the code. The program
> uses GhostScript to do the conversion, by default. Has that moved
> or been installed in a non-standard place. Can the gs command be found?
>
> The command above will show you the command it is trying to execute. Can
> you execute that command from a Unix prompt?

It would also be helpful to know if you have problems with raster files:

cgps2raster, 'test.ps', /png

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88163 is a reply to message #88152] Tue, 25 March 2014 06:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats,

OK, here is what I think is going on here.

IDL 8.3 is being shipped with a version of zlib (1.2.3) that is
incompatible with the version of zlib (1.2.8) that is being used by
recent versions of Ghostscript and ImageMagick. This results, then, in
an inability to spawn these commands from within IDL. Although the same
commands will work correctly when issued from a UNIX command line.

Barry Lesht discovered on his Mac that replacing IDL's version of zlib
with the version of zlib used by ImageMagick restored this
functionality:

http://www.idlcoyote.com/graphics_tips/macspawnim.php

I'm guessing something of the sort will be required on the UNIX side,
too.

Cheers,

David

>
> Den tisdagen den 25:e mars 2014 kl. 13:30:32 UTC+1 skrev David Fanning:
>> David Fanning writes:
>>> Mats Löfdahl writes:
>>
>>>> We recently upgraded to IDL version 8.3 (from version 7.1) and now my cgwindows do not seem to be able to create PDF files. When I try a window pops up with an error message: "CGCMDWINDOW::AUTORASTERFILE: Unable to create PDF file. See cgPS2PDF documentation."
>>
>>>> A test session:
>>
>>>> IDL> cgwindow
>>>> IDL> cgplot,[1,2],/add
>>>> IDL> cgcontrol,output='test.pdf'
>>
>>>> I looked at https://www.idlcoyote.com/idldoc/cg/cgps2pdf.html without finding anything obvious.
>>
>>>> I have updated the Coyote library today. PDF file creation still works in idl version 7.1.
>>
>>>> My environment is Debian 3.12 x86_64 GNU/Linux.
>>
>>> Well, these commands still work in my IDL 8.2.3. I would start by making
>>> something simpler.
>>
>>> cgps_open, 'test.ps'
>>> plot, indgen(11)
>>> cgps_close
>>
>>> Now, can you create a PDF file?
>>
>>> cgps2pdf, 'test.ps', /showcmd
>>
>>> If not, why not? You might have to step though the code. The program
>>> uses GhostScript to do the conversion, by default. Has that moved
>>> or been installed in a non-standard place. Can the gs command be found?
>
> Hi David,
>
> It does not work. Instead of showing the command, an error message is shown in a pop-up window: "CGPS2PDF: Cannot successfully SPAWN a Ghostscript command. No conversion possible." (And also in the terminal window, after I click the OK button in the popup window.)
>
> It doesn't seem to be a problem with spawn in general, as I can do this:
>
> IDL> spawn,'which gs'
> /usr/bin/gs
>
> which also shows that gs can be found. If not by IDL, at least by the shell.
>
> And I promise that I'm not moving gs around between succeeding with idl version 7 and failing with version 8. :o)
>
>
>>> The command above will show you the command it is trying to execute. Can
>>> you execute that command from a Unix prompt?
>
> The error message must have stopped the command from showing. But from reading the code, I guess it should look something like this:
>
> $ gs -sDEVICE=pdfwrite -q -dNOPAUSE -dBATCH -sPAPERSIZE=letter -sOutputFile=test.pdf test.ps
>
> And this works fine from the command line. The pdf file looks as it should.
>
>
>> It would also be helpful to know if you have problems with raster files:
>>
>> cgps2raster, 'test.ps', /png
>
> This produced some more error messages, this time only in the terminal window:
>
> IDL> cgps2raster, 'test.ps', /png
> % Compiled module: CGPS2RASTER.
> % Compiled module: SETDEFAULTVALUE.
> % Compiled module: CGROOTNAME.
> % Compiled module: CGWINDOW_GETDEFS.
> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
> convert.im6: Postscript delegate failed `test.ps': No such file or directory @ error/ps.c/ReadPSImage/832.
> convert.im6: no images defined `PNG24:/scratch/mats/2013.10-processing/limb-drift-scans/201 3-10-28/test.png' @ error/convert.c/ConvertImageCommand/3044.
>
> Again, when I try it in IDL 7.1, it works fine.
>
> Maybe this is not coyote related at all? Do IDL versions 7 and 8 not co-exist well?
>
> $ env | grep IDL
>
> does not show anything obviously version dependent, but are there any known changes I need to do to my setup to make it work with version 8? (or preferably with both 8 and 7.)
>
> /Mats



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88164 is a reply to message #88152] Tue, 25 March 2014 06:52 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
>
> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
>
> convert.im6: Postscript delegate failed `test.ps': No such file or directory @ error/ps.c/ReadPSImage/832.
>
> convert.im6: no images defined `PNG24:/scratch/mats/2013.10-processing/limb-drift-scans/201 3-10-28/test.png' @ error/convert.c/ConvertImageCommand/3044.


Could be similar to the problem I had with ImageMagick. IDL packages its own version of zlib. Once I moved the pointer from IDL's version to ImageMagick's version, everything worked. I do not see an entry for gs, but perhaps there is one in 8.3.

On my Mac I had to change

/Applications/exelis/idl82/bin/bin.darwin.x86_64l/ibz.1.dyli b -> libz.1.2.3.dylib

to

/Applications/exelis/idl82/bin/bin.darwin.x86_64/libz.1.dyli b -> /opt/local/lib/libz.1.2.8.dylib


I do see
/Applications/exelis/idl82/bin/bin.darwin.x86_64/idl_jpeg.so



https://groups.google.com/forum/#!searchin/comp.lang.idl-pvw ave/imagemagick%7Csort:date/comp.lang.idl-pvwave/rJYYbacwl4U /aCH2Ne2CwZcJ
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88166 is a reply to message #88163] Tue, 25 March 2014 07:09 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdagen den 25:e mars 2014 kl. 14:51:27 UTC+1 skrev David Fanning:
> Mats,
>
> OK, here is what I think is going on here.
>
> IDL 8.3 is being shipped with a version of zlib (1.2.3) that is
> incompatible with the version of zlib (1.2.8) that is being used by
> recent versions of Ghostscript and ImageMagick. This results, then, in
> an inability to spawn these commands from within IDL. Although the same
> commands will work correctly when issued from a UNIX command line.
>
> Barry Lesht discovered on his Mac that replacing IDL's version of zlib
> with the version of zlib used by ImageMagick restored this
> functionality:
>
> http://www.idlcoyote.com/graphics_tips/macspawnim.php
>
> I'm guessing something of the sort will be required on the UNIX side,
> too.

Thanks a bunch David. I'll ask my sysadm to have a look at it and report back when we've tried it.
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88167 is a reply to message #88164] Tue, 25 March 2014 07:12 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdagen den 25:e mars 2014 kl. 14:52:36 UTC+1 skrev Matthew Argall:
>> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
>
>> gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory
>
>> convert.im6: Postscript delegate failed `test.ps': No such file or directory @ error/ps.c/ReadPSImage/832.
>
>> convert.im6: no images defined `PNG24:/scratch/mats/2013.10-processing/limb-drift-scans/201 3-10-28/test.png' @ error/convert.c/ConvertImageCommand/3044.
>
> Could be similar to the problem I had with ImageMagick. IDL packages its own version of zlib. Once I moved the pointer from IDL's version to ImageMagick's version, everything worked. I do not see an entry for gs, but perhaps there is one in 8.3.
>
> On my Mac I had to change
>
> /Applications/exelis/idl82/bin/bin.darwin.x86_64l/ibz.1.dyli b -> libz.1.2.3.dylib
>
> to
>
> /Applications/exelis/idl82/bin/bin.darwin.x86_64/libz.1.dyli b -> /opt/local/lib/libz.1.2.8.dylib
>
> I do see
>
> /Applications/exelis/idl82/bin/bin.darwin.x86_64/idl_jpeg.so
>
> https://groups.google.com/forum/#!searchin/comp.lang.idl-pvw ave/imagemagick%7Csort:date/comp.lang.idl-pvwave/rJYYbacwl4U /aCH2Ne2CwZcJ

Thanks Mathew. I saw David's message first, but I guess this is similar in spirit. I appreciate the response anyway.
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88168 is a reply to message #88166] Tue, 25 March 2014 07:17 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

>
> Den tisdagen den 25:e mars 2014 kl. 14:51:27 UTC+1 skrev David Fanning:
>> Mats,
>>
>> OK, here is what I think is going on here.
>>
>> IDL 8.3 is being shipped with a version of zlib (1.2.3) that is
>> incompatible with the version of zlib (1.2.8) that is being used by
>> recent versions of Ghostscript and ImageMagick. This results, then, in
>> an inability to spawn these commands from within IDL. Although the same
>> commands will work correctly when issued from a UNIX command line.
>>
>> Barry Lesht discovered on his Mac that replacing IDL's version of zlib
>> with the version of zlib used by ImageMagick restored this
>> functionality:
>>
>> http://www.idlcoyote.com/graphics_tips/macspawnim.php
>>
>> I'm guessing something of the sort will be required on the UNIX side,
>> too.
>
> Thanks a bunch David. I'll ask my sysadm to have a look at it and report back when we've tried it.

I wonder if Chris Torrance can give us some help in how to go about
replacing the IDL 8.3 zlib package with a more recent one?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgwindow unable to create PDF file in IDL 8.3 [message #88174 is a reply to message #88166] Tue, 25 March 2014 09:37 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdagen den 25:e mars 2014 kl. 15:09:21 UTC+1 skrev Mats Löfdahl:
> Den tisdagen den 25:e mars 2014 kl. 14:51:27 UTC+1 skrev David Fanning:
>
>> Mats,
>
>> OK, here is what I think is going on here.
>
>> IDL 8.3 is being shipped with a version of zlib (1.2.3) that is
>> incompatible with the version of zlib (1.2.8) that is being used by
>> recent versions of Ghostscript and ImageMagick. This results, then, in
>> an inability to spawn these commands from within IDL. Although the same
>> commands will work correctly when issued from a UNIX command line.
>
>> Barry Lesht discovered on his Mac that replacing IDL's version of zlib
>> with the version of zlib used by ImageMagick restored this
>> functionality:
>
>> http://www.idlcoyote.com/graphics_tips/macspawnim.php
>
>> I'm guessing something of the sort will be required on the UNIX side,
>> too.
>
> Thanks a bunch David. I'll ask my sysadm to have a look at it and report back when we've tried it.

I got immediate feedback from my sysadm:

"Hm, it appears that on Linux, IDL does not have its own version of zlib,
instead it always uses the one from the operating system. Which is the same one
that ImageMagick uses."

I then showed him this thread and he realized that the important error message was this:

gs: error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory

That version of libjpeg was not installed on the computer I was using. Now it is, and my problems are gone.

Thanks again!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Some histogram magic help required - gridding/counting large dataset
Next Topic: Map Projection Bug?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:33:33 PDT 2025

Total time taken to generate the page: 0.00735 seconds