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   |
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.")
|
|
|