Save Spectra as Postscript File and Convert to JPG or TIF

This describes how to save the plot as a postscript file that is readable by Adobe Illustrator or Photoshop, etc. The second will be on color plots, the third on saving and transferring the real NMR data, and the last processing NMR data when typing on a Mac or PC.

I have written short VNMR macros that will allow for the export of plots to files for transfer to PCs/Macs. Although I have tested the macros successfully, there is some possibility that there will be some problems that will need
fixing. Thus, if there are problems with any of the steps, let me know.

Anybody already making postscript files and successfully exporting to Adobe Illustrator, Photoshop, etc. does not need to anything differently.

Step 1:
Create a postscript plot.
When you type the page command, the VNMR software will either
1) Output an HP language plot that will be printed on our various HP printers attached to the NMR computers
or
2) Output an Adobe postscript format plot, which can be either saved as a file, readable by a number of software programs or will be printed to paper, but ONLY on a postscript printer- the Mercury 400 and UI600 have one, all other NMRs would print to the printer attached to the workstation- nmr1.

Normally, you type:
page <return>
then the plot will be printed to paper
if instead you type:
page('filename.ps')
the plot, with all the arguments that you gave it such as pl pscale ppf will be saved as a file with, in this case, the name of: filename.ps (you can call it whatever you want; the .ps is to indicate a postscript plot). The file will be
saved in whatever directory that you are currently in.

If you want to transfer the plot to your PC/Mac computer, it MUST be postscript format to be readable. Thus, in VNMR you MUST tell the software that you want a postscript plot NOT an HP language plot. I have written 2 macros on all NMRs (except the XL400) that will switch back and forth between postscript (so plot to file) and HP language (so plot to paper).
The macros are executed in VNMR window, type:
pp
will switch to HP language (so print to paper) or:
pfile
will switch to postscript (so print to file)

If you ever run one of the macros you must run the other to do the reverse. If you always print to paper you do not need to run the macro; if you always print to postscript files, you need to run it once and never again. If you forget to run the pfile macro to switch from paper to file, your plot will be unreadable; if you forget to run the pp macro to switch from file to paper, your plot will be printed as postscript on the printer attached to nmr1 from all computers except the merc400 and ui600. These macros do the same thing as clicking on the Select Plotter and Select Printer menu buttons.

Step 2.
Darken the postscript file (Optional).
Varian postscript files are usually a little bit light (or grey) because the lines are very narrow. I have written a macro that will darken the postscript file by thickening the lines called darkenps. The syntax is:
darkenps('filename')
where filename is the name of the file without the .ps extension. It will make the plot darker by thickening the lines, and then save the file as: filename.ps.

This is step is not absolutely necessary, especially if you are going to covert to an image format for Adobe Photoshop.

Step 3.
Transfer the plot file.
To transfer the plot file you must use some sort of file transfer protocol (ftp) or secure copy (scp) to transfer the plot file to your computer. On a PC, the stanford website allows download of a program called SecureFX (or sfx),
similarly Macs use Fetch or ftp from the OS X Unix terminal.

Then, you ftp to the nmr computer:
ui600.stanford.edu (for the 600)
ui500.stanford.edu (for the 500)
merc400.stanford.edu (for the 400)
gem300.stanford.edu (for the 300 in Mudd)
ui300.stanford.edu (for the 300 in Stauffer)
gem200.stanford.edu (for the 200)
nmr1.stanford.edu (for the Sun workstation)
nmr4.stanford.edu (for the SGI workstation)

You will be asked for login name/password, as you would be on the instrument. The program will put you in your normal login directory; unless you have changed directories on the instrument before you saved the file, that is where the file will be. If the file is not there you will need to change directories in the ftp program. At this point, you should be able to drag-and-drop the files that you want to your computer. Then, close the connection when you are done.

Step 4.
Convert the plot file to a readable format.
The plot file is an Adobe postscript file. It should have a .ps extension such as filename.ps not filename; if it does not, you should probably add it.

Choices of what to do with the plot file:

1) It should be readable directly by Adobe Illustrator; this is probably the best option, as NMR spectra are lines and text and that is what Illustrator is optimal for. Illustrator files (or postscript files) are small in size relative
to image files of Adobe Photoshop. If you are using Illustrator the darkenps command executed in VNMR should be useful.

2) It should be readable directly by Adobe Distiller to create a .pdf file. The disadvantage of this is that the pdf format documents would be hard to modify. If you are using this method the darkenps command executed in VNMR should also be useful.

3) It should be readable by Adobe Photoshop, but it will ask you for document size and resolution. You should make it ~300 dpi.

4) While the postscript file is directly readable by Adobe Photoshop, another way is to convert the file to an image format before transferring the file. I have written macros to do this conversion at 300 dpi. The macros are:
pstotiff (coverts to tiff format), pstojpg (coverts to jpg format), pstopsd (coverts to photoshop format), pstopict (coverts to pict format)

As Adobe photoshop reads all of these file types, normally the choice would be between jpg and tiff (or tif). The difference is that the jpg documents are compressed so they are smaller in file size but some information is lost. What I have observed is the tiff (or psd) are very slightly cleaner than the jpg.

These macros covert the files at 300 dpi and darken the image, so the darkenps macro should not be necessary. If you want higher resolution, contact me.

The syntax of those macros is:
pstojpg('filename')
This will convert a file called filename.ps filename.jpg or a file called filename first to filename.ps then filename.jpg
The other macros work similarly.

Note that these macros are not accomplished instantaneously; just as when you open a large Photoshop document on a PC/Mac it can be slow. The newer computers, all except the 200 and Inova 300 take ~10-20 seconds for the conversion. The 2 old computers can be 30 seconds or more. You can continue to type commands but there will be no response until the conversion is done.

5) If you still cannot read the file, contact me as there are other alternatives.


THUS, to print to postscript file:

1. Convert to postscript output, type:
pfile

2. Type print commands:
pl pscale ppf pir
or
pcon(10,1.2)
as you would if you were printing to paper

3. Save the file rather than printing:
page('filename.ps')

4. (Optional) Darken the postscript file:
darkenps('filename')

5. (Optional) Convert to image file:
pstojpg('filename')
or
pstotiff('filename')

6. Ftp file to your computer from ui500 or merc400 or ui300 or ui600 or gem300
or gem200 or nmr1

7. Open .ps file with Adobe Illustrator; open .jpg or .tiff file with Adobe Photoshop, etc.


Then to switch back to paper if desired:

1. Convert to HP language output, type:
pp

2. Type print commands such as:
pl pscale ppf pir

3. Then, type:
page

 

 
NMR Facility Home  |  Stanford University  |  Department of Chemistry

 

© Stanford University. All Rights Reserved. Stanford, CA 94305. (650) 723-2300