Export to PDF

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Export to PDF

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Export to PDF

Unread post by TomDoan »

That's an Operating System (i.e. Windows) command, not a RATS command.
hussain19
Posts: 3
Joined: Tue May 07, 2019 9:27 am

Re: Export to PDF

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Export to PDF

Unread post 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.
hussain19
Posts: 3
Joined: Tue May 07, 2019 9:27 am

Re: Export to PDF

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Export to PDF

Unread post 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.
Post Reply