Printing with SAS |
Overview of Portable Network Graphics (PNG) in SAS |
Portable Network Graphics (PNG) is a raster image format that was designed to replace GIF and TIFF image formats that are viewed on the World Wide Web. PNG images that are created with a SAS Universal Printer or a SAS/GRAPH device driver use the PNG Reference Library, Version 1.2.8, also known as libpng. The PNG device is the default graphics device for ODS HTML destinations.
SAS provides three PNG Universal Printers.
Use the ODS Listing, Printer, or HTML destinations to create PNG images. For PNG images created by SAS/GRAPH devices, use the ODS Listing and ODS HTML destinations. For PNG images created by Universal Printers, use the ODS Printer destination. For information about creating PNG images by SAS/GRAPH devices, see SAS/GRAPH: Reference.
To create PNG images using Universal Printers, specify a PNG Universal Printer as the value of the PRINTERPATH system option, and the ODS PRINTER statement as shown in the following example:
options printerpath=png; ods listing close; ods printer; ...more SAS code... ods printer close; ods listing;
SAS creates a PNG file with the name sasprt.png.
Although many browsers support PNG images, the following browsers, using the specified version or later, support most PNG image capabilities:
Microsoft Internet Explorer 7.01b
Mozilla Firefox 1.5.0.4
Netscape Navigator 6
Irfan View for Windows
Microsoft Photo Editor
Windows Picture and Fax Viewer
Creating PNG Files Using ODS Printer |
To create a PNG image in SAS using one of the PNG Universal Printers, specify the PNG printer in the PRINTERPATH= system option and the ODS PRINTER statement as shown in the following example:
options printerpath=png; ods listing close; ods printer; data hat; do x=-5 to 5 by .25; do y=-5 to 5 by .25; z=sin(sqrt(x*x+y*y)); output; end; end; proc g3d data=hat; plot y*x=z/ctop=red; title 'Cowboy Hat with G3D'; run; quit; ods printer close; ods listing;
The following output is the PNG graphic displayed in Internet Explorer:
You can create PNG images for any procedure out. You are limited only by what fits on the paper size that is used to define the size of the image.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.