Most of these programs will accept Postscript or encapsulated Postscript as input. However, in some cases, non-Postscript formats are needed or preferred. For example, web browsers typically expect GIF, PNG, or JPEG images. Also, Dataplot does not generate the optional bit-map preview for encapsulated Postscript (although you can add one using Ghostview on Windows). Most programs do not actually convert Postscript files. Instead, they use the bit-map preview when displaying on non-Postscript devices and the original Postscript when displaying on Postscript devices. In these cases, it may be more convenient to import a JPEG version of the graph.
The SET POSTSCRIPT CONVERT command is used to specify one of the following devices:
If one of these devices is set and a Postscript device is closed, then Dataplot invokes Ghostscript to convert the Postscript output to the specified device. The original Postscript file is preserved. The new file has the same name with the file extension replaced with "jpg", "pdf", "tif", "pbm", "pgm", "ppm", or "pnm" (depending on the selected device).
Note that Ghostscript supports conversion to a wide variety of output devices. The devices selected above were the ones that are the most useful in exporting Dataplot graphs to other software programs. Since our purpose for this command was to provide graphic formats suitable for input into other programs, we did not add support for the printer devices. If your main interest is simply in printing to a non-Postscript device, then run Ghostview after exiting Dataplot to print the Postscript file.
Between the original Postscript and the devices supported using the SET POSTSCRIPT CONVERT, it should be possible to import Dataplot graphics into most external programs. In particular, the JPEG and PBM formats (PBM, PGM, PPM, and PNM) are supported by most image conversion programs.
Alternatively, you can also use the "convert" program from the Image Magick software or the PS2PDF program (part of the Ghostscript installation). See the Note section below for details. Syntax 1:
where <device> is one of JPEG, PDF, TIFF, PBM, PGM, PPM, or PNM (any other choice is converted to NULL).
where <program> is one of GHOSTSCRIPT, CONVERT, or PS2PDF.
where <program> is one of GHOSTSCRIPT, CONVERT, or PS2PDF. and <device> is one of JPEG, PDF, TIFF, PBM, PGM, PPM, or PNM (any other choice is converted to NULL).
SET POSTRSCRIPT CONVERT JPEG
SET POSTRSCRIPT CONVERT PPM
For Unix platforms, Ghostscript is launched with the command
If gs is not in your default path, you can enter something like
On Windows platforms, Ghostscript is launched with
where <ghostscript path> is the directory defined by the SET GHOSTSCRIPT PATH command. As of the 08/2019 version of Dataplot, the default path is
If Ghostscript is installed in a different directory (typically the "GS9.27" will be different if you have installed a different version of Ghostscript), you can specify the correct directory with the command
Enter HELP GHOSTSCRIPT PATH for details.
If you have installed the 64-bit version of Ghostscript, enter the command
This will run the command GSWIN64C.EXE instead of GSWIN32C.EXE. To reset the 32-bit version, enter
If you select the CONVERT option, you must have the Image Magick software installed on your local platform and the convert program should be in your default path.
To add directories to your default path, do the following
Then use the "Enviroment Variables" menu to add the needed directories. Note:
To reset the use of Ghostscript, enter
You can also specify the use of the ps2pdf program to perform the conversion. The ps2pdf program is a batch script file that is typically installed as part of the Ghostscript installation. Linux installations will typically have Ghostcript and ps2pdf installed.
The GHOSTSCRIPT option generates a Ghostscript command to perform the conversion, so the GHOSTSCRIPT and PS2PDF options perform essentially the same conversion. The advantage of the PS2PDF option is that it has a simpler syntax. The advantage of the GHOSTSCRIPT option is that it is not limited to converting the Postscript to PDF format (it also supports JPEG, TIFF, PBM, PBM, PGM, PPM, and PNM).
The SET GHOSTSCRIPT PATH applies to the PS2PDF option as well.
SET CONVERT DENSITY VERTICAL <value>
ORIENTATION LANDSCAPE WORDPERFECT
SET IPL1NA PLOT1.PS
DEVICE 2 POSTSCRIPT
... generate first plot ...
DEVICE 2 CLOSE
SET IPL1NA PLOT2.PS
DEVICE 2 POSTSCRIPT
... generate second plot ...
DEVICE 2 CLOSE
After these commands are run, you will have the Postscript files PLOT1.PS and PLOT2.PS. In addition, you will have the JPEG files PLOT1.jpg and PLOT2.jpg.
PDF may sometimes be the exception. Acroread (and other PDF viewers) can read PDF files with multiple graphs in them.
If the PDF format is specified and the CAPTURE HTML command is activated, Dataplot will generate a link to the PDF file in the generated HTML code. Enter HELP CAPTURE for more information about the CAPTURE HTML option
2007/10: Added support for the "convert" program from ImageMagick
2009/03: Added support for user specified density
2019/08: Added support for the "ps2pdf" program
SET GHOSTSCRIPT PATH /usr/local/src/bin/ SET POSTSCRIPT CONVERT JPEG DEVICE 2 POSTSCRIPT PLOT SIN(X) FOR X = -6 0.1 6 DEVICE 2 CLOSE SYSTEM xv dppl1f.jpg