System Options That Affect PDF Output
Before you create PDF output, you can use SAS system options to set document security
restrictions. The document security restrictions specify what can be done to the
document, as well as the security method, the printing resolution, and the encryption
level.
The following table lists the system options that can be used to set the PDF document
security restrictions:
System Option Description
PDFACCESS Specifies whether the PDF document can be edited.
PDFASSEMBLY Specifies whether PDF documents can be assembled.
PDFCOMMENT Specifies whether PDF document comments can be modified.
PDFCONTENT Specifies whether the contents of a PDF document can be
changed.
PDFCOPY Specifies whether text and graphics from a PDF document can
be copied.
PDFFILLIN Specifies whether PDF forms can be filled in.
PDFPAGELAYOUT Specifies the page layout for PDF documents.
PDFPAGEVIEW Specifies the page viewing mode for PDF documents.
PDFPASSWORD Specifies the password to use to open a PDF document and the
password used by a PDF document owner.
PDFPRINT Specifies the resolution to print PDF documents.
PDFSECURITY Specifies the level of encryption for PDF documents.
Creating PNG (Portable Network Graphics) Files
Using Universal Printing
Portable Network Graphics in SAS
Portable Network Graphics (PNG) is an 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 the SAS Universal Printer or a SAS/GRAPH device driver use the PNG
Reference Library, also known as Libpng. PNG is the default format for graphics output
for the ODS HTML destination and for SAS/GRAPH.
Creating PNG (Portable Network Graphics) Files Using Universal Printing 311
For a description of the PNG printer, you can either view the printer in the SAS registry
or submit the following QDEVICE procedure and view the output in the SAS log:
proc qdevice;
printer png;
run;
See Also
“Color Support for Universal Printers” on page 247
The PNG Universal Printers
SAS provides three PNG Universal Printers.
Table 15.18 PNG Universal Printers Provided by SAS
Printer Name Description
PNG produces PNG images at 96 dpi
PNGt produces PNG images at 96 dpi with a transparent background
PNG300 produces PNG images at 300 dpi
PNG printers do not support multiple page documents. If a procedure creates multiple
pages or if more than one procedure is used in the code for ODS PRINTER output, only
the first page is viewable.
Creating a PNG Image
You can create a PNG image using the ODS PRINTER statements. You specify the PNG
Universal Printer as the value of the PRINTERPATH= system option or as the value of
the PRINTER= option in the ODS PRINTER statement.
Here is sample code to create a PNG image:
ods html close;
ods printer printer=png;
...more SAS code...
ods printer close;
ods html;
SAS creates the file sasprt.png in the current directory.
In SAS/GRAPH, the PNG device is a shortcut to the PNG Universal Printer. For
information about creating PNG images using SAS/GRAPH devices, see SAS/GRAPH:
Reference.
Example of Creating a PNG File Using the ODS PRINTER Statement
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:
312 Chapter 15 Printing with SAS
options printerpath=png nodate;
ods html close;
ods printer;
proc sgplot data=sashelp.stocks
(where=(date >= "01jan2000"d and stock = "IBM"));
title "Stock Trend";
series x=date y=close;
series x=date y=low;
series x=date y=high;
run;
ods printer close;
ods html;
The following output is the PNG graphic displayed in Windows Picture and Fax Viewer:
Figure 15.32 A PNG Image Using ODS Printer
Web Browsers and Viewers That Support PNG Files
The following browsers and viewers, 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
IrfanView for Windows
Microsoft Photo Editor
Creating PNG (Portable Network Graphics) Files Using Universal Printing 313

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.