Printing Your Graph

About Printing Graphs

You can print your SAS/GRAPH output on hard-copy devices such as a printer. Regardless of the destination, you can create a hard copy of your graph in one of the following ways:
  • Print the SAS/GRAPH program output directly to a hard-copy device.
  • Print the SAS/GRAPH program output by creating a graphics output file, HTML file, or PDF file, and then printing the file using host commands or host application commands.
  • Print the displayed graph directly from the GRAPH or Results Viewer window or the Graphics Editor window.
  • Print the displayed graph directly from a browser that supports the SVG format.

Sending Your Graph Directly to a Printer

You can send graphics output directly to a hard-copy device by sending the graphics commands directly to the device or to a device port. On most systems, you can use any of the following methods to print directly to a device:
  • Use the ODS PRINTER destination to send your output directly to the default printer. Use the PRINTER= option if you want to direct your output to a printer other than the default printer or if a default printer is not defined.
    See the SAS Output Delivery System: User's Guide for information about the ODS PRINTER statement.
    See the SAS Language Reference: Concepts for information about how to define a default printer for the Universal Printer.
  • Use a FILENAME statement, a GOPTIONS statement, and a SAS/GRAPH device. The FILENAME statement defines a file reference that points to the print commands to send your output to any available hard-copy device. The GOPTIONS statement references the file reference, assigns the device, and specifies any additional parameters.
  • Use the GDEVICE procedure to modify a SAS/GRAPH device entry to spool output directly to a printer. See GDEVICE Procedure for information about adding host commands to a device entry.
  • Use the Universal Printing interface.
For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.

Saving and Printing Your Graph

You can save your graph to a graphics output file, and then print the file using host commands. You can perform these two steps separately or combine them by incorporating the host printing commands into your program or graphics output device. In any case, you must choose a graphics file format that is compatible with your printer. For example, if you are using a PostScript printer, be sure to create a PostScript file using the appropriate device for the printer.
You can use any of the following methods to create and print a graphics output file:
  • Use FILENAME and GOPTIONS statements to create the graphics output file, and then use a host command to spool the file to a spooler for the device.
  • Use an ODS PRINTER statement to produce a Postscript, PDF, PCL, SVG, PNG, or GIF file. Then use a host command or a host application command to send the file to the printer.
  • Use the GDEVICE procedure to modify a SAS/GRAPH device to save the output to a graphics output file and spool the output directly to a printer. See GDEVICE Procedure for information about modifying device entries.
  • Use the Universal Printing interface.
    Note: On Windows platforms, the ODS PRINTER destination uses the Universal Printing interface in addition to the Windows system printers.
For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.