SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

GHOSTSCRIPT PRINTER

Name:
    GHOSTSCRIPT PRINTER (SET)
Type:
    Set Subcommand
Purpose:
    Specify whether the Ghostview/Ghostscript GSPRINT command is used to implement the PP command.
Description:
    Under Windows, printing Dataplot graphs has been a bit of an issue. Dataplot supports Postscript printers and printers that provide HPGL emulation (i.e., most HP LaserJet printers) directly. However, there is no built-in support for the various ink jet and desk jet printers. The recommended solution has been to install the freely downloadable Ghostview/Ghostscript software and use this to print Dataplot generated Postscript files on non-Postscript printers. The limitations of this approach were that the PP command (which prints the most recent graph from within a Dataplot session) was not available and you had to run a separate program to print your graphs.

    Ghostview also provides the command "GSPRINT" that will run ghostscript automatically to print a Postscript file on a generic Windows printer. The use of GSPRINT allows the PP command to work with any generic Windows printer.

    In order to make use of GSPRINT, We have added the following command to Dataplot:

      SET GHOSTSCRIPT PRINTER

    If set to OFF (the default), then the Dataplot PP command will execute the following command:

      COPY DPPL2F.DAT

    If set to ON, then the Dataplot PP command will execute the following command:

      C:\Ghostgum\Ghostview\GSPRINT.EXE -printer "printer-id" DPPL2F.DAT

    If you want the PP command to print to either a Postscript printer or a printer with HP-GL emulation, then it is recommended that you leave this switch set to OFF. For all other printers, we recommend you set this switch to ON.

    If you set this to ON, then use DEVICE 2 POSTSCRIPT as the device for DPPL1F.DAT (DEVICE 3, used for DPPL2F.DAT, defaults to Postscript). If you want to print the DPPL1F.DAT file (which will contain all plots generated since the DEVICE 2 command), then you can do something like the following:

      DEVICE 2 POSTSCRIPT
      ... generate one or more plots ...
      DEVICE 2 CLOSE
      SYSTEM C:\Ghostgum\Ghostview\GSPRINT.EXE DPPL1F.DAT

    There are three issues that you need to be aware of.

    1. Entering SET GHOSTSCRIPT PRINTER ON assumes that you have installed Ghostview/Ghostscript on your local machine. The version of Ghostscript must be at least 6.5 (which is fairly old by now). Note that we include a copy of Ghostview/Ghostscript on the Dataplot CD and on the Dataplot ftp site. You can also download it from the Ghostview site:

        http://www.cs.wisc.edu/~ghost/

    2. If you did not install Ghostview in the default directory (C:\Ghostgum\GhostView), then you can specify the directory containing the Ghostview program (and the GSPRINT program) with the following command:

        SET GHOSTVIEW PATH

      For example, if you installed Ghostview on the D: drive, enter the following:

        SET GHOSTVIEW PATH D:\Ghostgum\Ghostview\

    3. By default, GSPRINT will send the plot to the default printer. If you want to use a printer that is not your default printer, you can do one of the following:

      • Use the Windows "Printers" menu (under the Programs/Settings menu or under the Control Panel menu) to temporarily redefine which printer is the default printer.

      • You can use the Dataplot SET PRINTER command to define the name of the printer.

        The names for network printers are site specific. Talk to your local site administrators to determine the names for your network printers (I cannot help you with this part).

        One recommendation is to run GSPRINT independently of Dataplot to test the correct names for the network printers you need to support. As these network names can be rather long and hard to remember, if you commonly use more than one printer, you can write a macro for each printer that sets the appropriate name for that printer. That is, instead of entering the SET PRITNER command each time, simply call the appropriate macro (that way, you only have to get the name right once).

        Be aware that GSPRINT can be picky about how the printer name is entered.

Syntax:
    SET GHOSTSCRIPT PRINTER <ON/OFF> where ON specifies that GSPRINT will be used and OFF specifies that GSPRINT will not be used.
Examples:
    SET GHOSTSCRIPT PRINTER ON
    SET GHOSTSCRIPT PRINTER OFF
Note:
    I recommend adding the following code to your C:\DATAPLOT\DPLOGF.TEX file (this is a startup file that is run when Dataplot is first initiated. Change the network printer id's to ones that are appropriate for your local site.

     
    .  FOR DEVICE 2 AND DEVICE 3 (file devices), THERE ARE 3 CASES:
    .
    .    i) You want to access a Postscript printer
    .   ii) You want to access a printer with HP-GL emulation
    .       (e.g., most HP LaserJet printers)
    .  iii) You want to access a generic printer that has neither
    .       Postscript or HPGL capability.
    .
    .       Set IDEV to 1, 2, or 3 based on the above.  Also, you may
    .       need to define the name of your network printer (the actual
    .       name will need to be obtained from your local site
    .       system administrator).
    .
    IDEV = 3
    .
    IF IDEV = 1
       . Postscript Case.  Set printer to PRN: for a local printer, to
       . the appropriate network id for a network printer.
       . SET PRINTER PRN:
       SET PRINTER "\\DCIS-NT3\HP8_PS"
       DEVICE 2 POSTSCRIPT
    ELSE IF IDEV = 2
       . HP-GL Case.  Set printer to PRN: for a local printer, to
       . the appropriate network id for a network printer.
       . SET PRINTER PRN:
       SET PRINTER "\\DCIS-NT3\HP8"
       DEVICE 2 HPGL LJET
    ELSE
      . Generic printer case.  Use the Ghostscript/Ghostview "GSPRINT"
      .  command.  This assumes that Ghostscript (at least version 6.5)
      .  and Ghostview have been installed.  If the path for Ghostview
      .  is not "C:\Ghostgum\Gsview", then set the correct path with
      .  the "SET GHOSTVIEW PATH" command.
      . If you do not want to access your default printer, then use the
      . SET PRINTER command to specify the printer id.
      .  SET PRINTER "\\DCIS-NT3\HP8 - HP 8000 Series PCL 5e"
      .  SET PRINTER "\\DCIS-NT3\HP8_PS - HP LaserJet 8000 Series PS"
      . SET GHOSTSCRIPT PATH F:\GHOSTGUM\GSVIEW\
      SET GHOSTSCRIPT PRINTER ON
    END IF
        
Default:
    The default is OFF.
Synonyms:
    None
Related Commands:
    PP = Print the current plot.
    SET GHOSTVIEW PATH = Set the directory where Ghostview (and GSPRINT) is installed.
    SET PRINTER = Set the printer used for the PP command.
Applications:
    Windows Printing
Implementation Date:
    2002/11
Program:
    SET GHOSTSCRIPT PRINTER ON
    PLOT SIN(X) FOR X = -6 0.1 6
    PP
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 11/26/2002
Last updated: 10/13/2015

Please email comments on this WWW page to alan.heckert@nist.gov.