Page 1 of 1

Export to PDF

Posted: Mon Nov 20, 2017 6:55 am
by Jules89
Dear Tom,

I recently upgraded to version 9.2. Therefore I should be able to export graphs to PDF. I also installed Ghostscript.
When I want to export a grafik to pdf by using for example the following lines of code:

Code: Select all

      gsave(format=pdf) "IRF_Mopo*.pdf"
      spgraph(vfields=2,hfields=1, header="Test Export")

         graph(nodates,number=0,header="test1") 5
         # upper90(4,4) / 3
         # upper68(4,4) / 2
         # irf(4,4) / 1
         # lower68(4,4) / 2
         # lower90(4,4) / 3

         graph(nodates,number=0,header="test2") 5
         # upper90(1,4) / 3
         # upper68(1,4) / 2
         # irf(1,4) / 1
         # lower68(1,4) / 2
         # lower90(1,4) / 3

      spgraph(done)      

Then a window pops uo, which states "Alert: Ghostscript not found"... Afterwards I cannot open the produced pdf. On the estima webpage the following is written:

This is built in to the Macintosh and UNIX. On Windows, you need to set an environment variable called GHOSTSCRIPT with the full path for the executable for (the console version) of GhostScript, such as with (the operating system command

SET GHOSTSCRIPT=C:\PROGRAM FILES\GS\GS9.16\BIN\GSWIN64C


However That does not work ... When I use SET GHOSTSCRIPT=C:\PROGRAM FILES\GS\GS9.16\BIN\GSWIN64C I get the following error:

## SX22. Expected Type SERIES[REAL], Got STRING Instead
>>>>SET GHOSTSCRIPT <<<<

I somehow need to tell RATS that ghostscript is installed and the location where to find it... How do I do that?

Thanks

Best

Jules

Re: Export to PDF

Posted: Mon Nov 20, 2017 7:19 am
by TomDoan
That's an Operating System (i.e. Windows) command, not a RATS command.

Re: Export to PDF

Posted: Wed Jun 26, 2019 3:31 am
by hussain19
Dear Tom
I have installed GS and set the environment variable using the command prompt.
However, when I try to save a graph in PDF, I still get the error 'GhostScript not found'.
I am using windows 10, RATS Pro64 10.0.

Re: Export to PDF

Posted: Wed Jun 26, 2019 10:08 am
by TomDoan
"GHOSTSCRIPT not found" should only come up if the environment variable isn't defined. Note that a SET on the Windows command line doesn't survive a reboot---to put something (permanently) into your environment, you need to change the environment variables. In type "Type here to search" box type "environment variables" it will give you the link to set system environment variables.

Re: Export to PDF

Posted: Wed Jun 26, 2019 12:30 pm
by hussain19
Do I need to create new system environment variable? Or I need to edit an existing one?
I tried to create a new system env var. It was asking for variable name and variable value. I tried several different names for "variable name" and browsed the relevant file for "variable value", that is-
"C:\Program Files\gs\gs9.27\bin\gswin64c.exe"
But I still get, GhostScript not found.
Please list the relevant steps in detail to fix it
Thank you.

Re: Export to PDF

Posted: Wed Jun 26, 2019 2:43 pm
by TomDoan
Did you already have a GHOSTSCRIPT environment variable? It needs to be GHOSTSCRIPT as the variable (under Windows, the case doesn't matter however). You should be able to see what you have by going to the command line prompt (type "CMD" in the "Type here to search" box) and type

SET GHOSTSCRIPT

at the command prompt. You can type EXIT to leave the command prompt.