Creating SVG (Scalable Vector Graphics) Files
Using Universal Printing
Overview of Scalable Vector Graphics in SAS
Scalable Vector Graphics in SAS
Scalable Vector Graphics (SVG) is an XML language for describing two-dimensional
vector graphics. SAS creates SVG documents based on the W3C recommendation for
SVG documents. SAS SVG documents are created using the UNICODE standard
encoding UTF-8.
SAS can create SVG documents by using Universal Printers and SAS/GRAPH device
drivers. Because SAS/GRAPH SVG device drivers use the SVG Universal Printers, this
section contains some information about creating SVG documents using SAS/GRAPH.
Most often in SAS, the SVG Universal Printers and device drivers are used to create
graphs. Graphs can be created by using ODS Graphics or SAS/GRAPH. You can also
use the SVG Universal Printers to show tables or reports that you create as SVG
documents.
Several ODS destinations (EPUB, HTML, HTML5, LISTING, and PRINTER
destinations) can be used to create SVG documents. SVG is the default Universal Printer
and device driver for the ODS HTML5 destination.
SVG documents can be stand-alone files or integrated within an HTML5 or EPUB file.
A stand-alone SVG document can be referenced as a link target, referenced as an
embedded file in an HTML document, or referenced as a CSS2 or XSL property. For
information about embedding SVG documents in web pages, see the topic on using SVG
documents in web pages in the SVG 1.1 specification on the W3 SVG website http://
www.w3.org/TR/SVG.
Multi-page SVG documents can be animated in Base SAS and SAS/GRAPH. When you
create animated SVG documents in Base SAS using Universal Printing without
specifying any ODS Graphics procedures, the animated SVG documents appear as a
slide show or an animated PowerPoint presentation. For more information, see “Creating
Animated GIF Images and SVG Documents” on page 345.
If you have SAS/GRAPH installed, your SVG documents can contain links and pop-up
text boxes.
The information provided here is limited to creating SVG documents using Universal
Printers in Base SAS and ODS Graphics. For more information about creating SVG files
in SAS/GRAPH, see “Enhancing Web Presentations with Chart Descriptions, Data Tips,
and Drill-Down Functionality ” in SAS/GRAPH: Reference.
For detailed information about the SVG standard, see the W3 documentation at http://
www.w3.org/TR/SVG.
SVG Terminology
SVG canvas
the space upon which the SVG document is rendered.
316 Chapter 15 Printing with SAS
viewBox
specifies the coordinate system and the area of the SVG document that is visible in
the viewport.
viewport
a finite rectangular space within the SVG canvas where an SVG document is
rendered. In SAS, the viewport is determined by the value of the PAPERSIZE=
system option for a scalable viewport and by the SVGWIDTH= and SVGHEIGHT=
system options for a static viewport.
viewport coordinate system or viewport space
the starting X and Y coordinates and the width and height values of the viewport.
user coordinate system or user space
the starting X and Y coordinates and the width and height values of the area of the
document to display in the viewport.
user units
is equal to one unit of measurement that is defined in your environment's coordinate
system. In many cases, the coordinate system uses pixels. Check with your system
administrator to determine the unit of measure that is used in your environment.
Why Create SVG Documents?
SVG documents are displayed clearly at any size in any viewer or browser that supports
SVG. SVG documents are ideal for producing documents to display on a computer
monitor, PDA, or cell phone; or documents to be printed. Because it is a vector graphic,
a single SVG document can be transformed to any screen resolution without
compromising the clarity of the document. In comparison, a multiple raster graphic
image might require using different screen resolutions in order to display the image at
various screen resolutions and sizes.
An SVG document might also be smaller in file size than the same image created by a
raster graphic Universal Printer, such as GIF or PNG.
Web Server Content Type for SVG Documents
If the mime content type setting for your web server does not have the correct setting for
SVG documents, your web browser might render SVG documents as text files, or SVG
documents might be unreadable.
To ensure that SVG documents are rendered correctly, configure your web server to use
this mime content type:
image/svg+xml
The SVG Universal Printers and the Output That They Create
The following table lists the SAS SVG Universal Printers.
Table 15.19 SVG Universal Printers
Printer Name Description
SVG
*
produces SVG 1.1 documents.
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing 317

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.