Universal Printing
What Is Universal Printing?
Universal Printing is a system that provides both interactive and batch printing
capabilities to create variety of document and graphic output formats. For example, you
can use Universal Printing to create HTML, PDF, documents, and PNG, GIF, and SVG
graphics. For a complete list of supported document and graphic types, see Table 15.1 on
page 240.
Universal Printing enables you to define printers and print previewers, and to set options
to control the printed output. In addition to creating the various document and graphic
output types, you can send output to a printer.
Windows Specifics
By default, the Windows operating environment uses Windows printing and not
Universal Printing. For more information about using Universal Printing under
Windows, see “Setting Up the Universal Printing Interface and the Default Printing
Environment” on page 239.
SAS routes all printing through Universal Printing services. All Universal Printing
features are controlled by system options, thereby enabling you to control many print
features, even in batch mode. For more information about these system options, see
“System Options That Control Universal Printing” on page 274.
Note: Before the introduction of Universal Printing, SAS supported a utility for print
jobs known as Forms. Forms printing is still available if you select File ð Print
Setup from the menu in the windowing environment. Then check the Use Forms
check box. This turns off Universal Printing menus and functionality. For more
information, see “Forms Printing” on page 282.
Setting Up the Universal Printing Interface and the Default Printing
Environment
Universal Printing in UNIX and z/OS
Universal Printing is enabled when SAS starts in the UNIX and z/OS operating
environments. No further action is required.
Universal Printing in Windows
Under Windows, Windows printing is enabled when SAS starts. To use Universal
Printing in Windows, you must set the UNIVERSALPRINT system option to enable the
Universal Printing environment, menus, and dialog boxes, and to set up the printing
defaults. If you use the SAS windowing environment, you can also use the
UPRINTMENUSWITCH system option to enable the print commands on the File menu.
These options can be set only in a SAS configuration file or at start-up. You cannot
enable or disable Universal Printing menus and dialog boxes after SAS starts.
Include the following system options when you start SAS:
-uprint -uprintmenuswitch
UPRINT is an alias for the UNIVERSALPRINT system option.
Universal Printing 239
If you start SAS with only the UPRINT option, you need to close the HTML destination,
which is open by default. Use the PRINTERPATH= option to specify the output format
type. Then, use an ODS PRINTER statement and ODS PRINTER CLOSE statement
around the code that you want to execute. Here is an example:
ods html close;
options printerpath=pdf;
ods printer;
proc print data=sashelp.class;
run;
ods printer close;
Return to the Default Printer
When you use the PRINTERPATH= system option to specify a printer, the print job is
controlled by Universal Printing. To return to the default Universal Printer (the
PostScript printer) set the PRINTERPATH= option to a null value (double quotation
marks with no space between them):
options printerpath="";
In Windows, when Universal Printing is not enabled, setting PRINTERPATH= to a null
value returns printing to Windows printing.
Universal Printing Output Formats
In addition to sending print jobs to a printer, you can also direct output to external files
that are widely recognized by different types of printers and software programs. You can
use Universal Printing to produce the following commonly recognized file types.
Table 15.1 Available Print Output Formats
Type Full Name Description
GIF Graphics
Interchange
Format
An image format designed for the online transmission and
interchange of graphic data. The format is widely used to
display images on the World Wide Web because of its smaller
size and portability.
EMF Enhanced
Metafile Format
A metafile format that is a collection of graphic drawing
commands, configuration properties, and graphic objects to
create true color, scalable, device-independent graphics.
Applications that support EMF run on Windows. Universal
Printing currently supports EMF, EMFPlus, and EMFDual
levels of the metafile format. The EMF Universal Printer uses
the EMFPlus level of metafile formatting, which is the default
EMF printer.
PCL Printer Control
Language
Developed by Hewlett-Packard as a language that applications
use to control a wide range of printer features across a number
of printing devices. Universal Printing currently supports
PCL4, PCL5, PCL5e, and PCL5c levels of the language.
240 Chapter 15 Printing with SAS
Type Full Name Description
PDF Portable
Document
Format
A file format developed by Adobe Systems for viewing and
printing a formatted document. To view a file in PDF format,
you need Adobe Reader, a free application distributed by
Adobe Systems.
Note: Adobe Acrobat is not required to produce PDF files with
Universal Printing.
PNG Portable
Network
Graphics
An image format that was designed as a replacement for the
older simple GIF format and the more complex TIFF format.
As with GIF, one of the major uses of PNG is to display images
on the web. PNG has these major advantages over GIF on the
web: gamma correction, two-dimensional interlacing, variable
transparency (alpha channel), setting the resolution, and more
than 256 colors.
PS PostScript A page description language developed by Adobe Systems.
This is the default Universal Printer.
SVG Scalable Vector
Graphics
A vector format that is a language for describing two-
dimensional graphics and graphical applications in XML.
TIFF Tagged Image
File Format
An Adobe raster image format that supports both image and
data in a single file. The TIFF Universal Printer supports
RGBA color printing and transparency. The TIFFk Universal
Printer supports CYMK color printing.
You set the value of the PRINTERPATH= system option to a Universal Printer or use
ODS statements to create output in one of the above formats. When the
PRINTERPATH= system option is set to a printer that prints to a file, the default
filename is sasprt.extension. extension is the printer format type. Here are some example
filenames: sasprt.pdf, sasprt.emf, sasprt.png, and sasprt.gif. The file is written to the
current directory.
You can use the PRINTERPATH= system option to change the location and the name of
the file. Here is an example:
options printerpath=(svg out);
filename out 'c:myimagesgraph1.svg';
Viewing Universal Printers and Printer Prototypes
SAS provides Universal Printers and printer prototypes that you can use to create your
own printers. You can access the list of available printers from the Print dialog box. You
can also use the QDEVICE procedure to create a data set of printers and then print the
printer information using the PRINT procedure.
To create a table of printers and print the list with a description of each printer, submit
this code:
proc qdevice out=printers;
printer _all_;
run;
proc print data=printers;
Universal Printing 241
var name desc;
run;
For more information, see “QDEVICE Procedure” in Base SAS Procedures Guide.
To print a list of printer prototypes to the SAS log, submit this SAS program:
filename registry temp;
proc printto log=registry;
run;
proc registry list keysonly levels=1 startat="coreprintingprototypes";
proc printto;
run;
data protypes;
keep prototype;
infile registry lrecl=300 pad;
length line $300;
input line $300.;
if substr(line,1,1) = "["
then do;
prototype = strip(substr(line,2,length(line)-2);
if index(prototype,'coreprintingprototypes') ne 0
then delete;
else
output;
end;
run;
proc print label;
label prototype = "Prototype";
run;
For more information, see “REGISTRY Procedure” in Base SAS Procedures Guide.
Viewing Universal Printer Settings
You can use the QDEVICE procedure or the Print dialog box to view the settings of a
Universal Printer. To view printer settings using the QDEVICE procedure, submit this
code:
proc qdevice;
printer printer-name;
run;
Here are the printer settings for the GIF printer:
242 Chapter 15 Printing with SAS
19 proc qdevice;
20 printer gif;
21 run;
Name: GIF
Description: Graphics Interchange Format RGB Color/Alpha Blending
Module: SASPDGIF
Type: Universal Printer
Registry: SASHELP
Prototype: GIF
Default Typeface: Cumberland AMT
Typeface Alias: Courier
Font Style: Regular
Font Weight: Normal
Font Height: 8 points
Font Version: Version 1.03
Maximum Colors: 16777216
Visual Color: True Color
Color Support: RGBA
Destination: sasprt.gif
I/O Type: DISK
Data Format: GIF
Height: 6.25 inches
Width: 8.33 inches
Ypixels: 600
Xpixels: 800
Rows(vpos): 50
Columns(hpos): 114
Left Margin: 0 inches
Minimum Left Margin: 0 inches
Right Margin: 0 inches
Minimum Right Margin: 0 inches
Bottom Margin: 0 inches
Minimum Bottom Margin: 0 inches
Top Margin: 0 inches
Minimum Top Margin: 0 inches
XxY Resolution: 96x96 pixels per inch
Compression Enabled: Always
Compression Method: LZW
Font Embedding: Never
Animation: Enabled
The QDEVICE procedure does not report all printer settings. For a description of the
printer settings that can be reported, see “QDEVICE Procedure” in Base SAS Procedures
Guide.
Modifying Universal Printing Printer Settings
You modify printer settings using the Universal Printer dialog boxes, by setting SAS
system options, or by using the PRTDEF procedure. See the following topics:
“Configuring Universal Printing Using the Windowing Environment” on page 257
“System Options That Control Universal Printing” on page 274
“Managing Universal Printers Using the PRTDEF Procedure” on page 276
Universal Printing and ODS
The ODS PRINTER statement can use Universal Printing whether the
UNIVERSALPRINT or NOUNIVERSALPRINT system option is set. The PRINTER
Universal Printing 243
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.54.136