Creating EMF (Enhanced Metafile Format) Graphics Using Universal Printing

EMF Graphics in SAS

Enhanced Metafile Format (EMF) graphics are scalable vector graphics that produce true color graphics. Applications that support EMF graphics run on Windows. The default output size of 800x600 pixels and the default resolution of 96 dpi produce output that closely resembles the screen resolution.
EMF graphics support TrueType and Type1 fonts. Use the FONTREG procedure to register Fonts. Alpha channel color support is available only for images.
Compression and font embedding are not supported. Transparency is supported for embedded images.
For a description of the EMF printer, submit the following QDEVICE procedure and view the output in the SAS log:
proc qdevice;
   printer emf;
run;

Creating an EMF Graphic

You can create a stand-alone EMF graphic using the ODS PRINTER statement. Specify the EMF universal printer either as the value of the PRINTERPATH= system option or as the value of the PRINTER= option in the ODS PRINTER statement. The following sample code specifies the EMF universal printer as the value of the PRINTER= option in the ODS PRINTER statement:
ods html close;
ods printer printer=emf;

...more SAS code...

ods printer close;
ods html;
SAS creates the file sasprt.emf in the current directory.

Example of Creating an EMF Graphic Using the ODS PRINTER Statement

Using the example data set SASHELP.CLASS and the SGPLOT procedure, the following ODS PRINTER statement prints the EMF file sasprt.emf in the current directory:
options printerpath=emf papersize=("4in" "4in") nodate;
ods html close;
ods printer;
proc sgplot data=sashelp.class;
  reg x=height y=weight / CLM CLI;
run;
ods printer close;
ods html;
The following output is the EMF metafile displayed in the Windows Picture and Fax Viewer:
SASHELP.CLASS in Enhanced Metafile Format
SASHELP.CLASS in Enhanced Metafile Format