TS-659: Exporting SAS/GRAPH Output to PDF Files from Release 8.2 and higher

Similar documents
Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

Chapter 13 Introduction to Graphics Using SAS/GRAPH (Self-Study)

IMPROVING A GRAPH USING PROC GPLOT AND THE GOPTIONS STATEMENT

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

DEFINE FILE FORMAT SPECIFICATIONS. CSV /TSV Specifications

III-6Exporting Graphics (Windows)

User s Guide to Creating PDFs for the Sony Reader

SAS/GRAPH : Using the Annotate Facility

Using SAS/GRAPH Software to Create Graphs on The Web Himesh Patel, SAS Institute Inc., Cary, NC

Modifying Graphics in SAS

AutoPagex Plug-in User s Manual

Maintaining a 'Look and Feel' throughout a Reporting Package Created with Diverse SAS Products Barbara B Okerson, Anthem, Inc.

OPTIMIZING PDFS WITH ACROBAT PRO 8

Managing SAS Output. Printing CHAPTER 5

Paper CC01 Sort Your SAS Graphs and Create a Bookmarked PDF Document Using ODS PDF ABSTRACT INTRODUCTION

Adobe Acrobat Distiller Online Guide

Making Your Excel Spreadsheets Accessible

Paper TS05. NOTE: To keep the paper compact, screen images have usually been clipped to show only the essential parts of the displayed result.

Making Your Excel Spreadsheets Accessible

Chapter 1 Introduction. Chapter Contents

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One

Creating Special Effects with Text

Paper SIB-096. Richard A. DeVenezia, Independent Consultant, Remsen, NY

The Evolution of a SAS/GRAPH Application Jenine Eason, AutoTrader.com, Atlanta, GA

FDA Portable Document Format (PDF) Specifications

The GIMPORT Procedure

A Plot & a Table per Page Times Hundreds in a Single PDF file

And Now, Presenting...

What you will learn 2. Converting to PDF Format 15 Converting to PS Format 16 Converting to HTML format 17 Saving and Updating documents 19

Presentation Quality Graphics with SAS/GRAPH

filepro PDF printing Specifying the destination FPML The filepro Markup Language

HOW TO UTILIZE MICROSOFT WORD TO CREATE A CLICKABLE ADOBE PORTABLE DOCUMENT FORMAT (PDF)

Calc Guide. Chapter 6 Printing, Exporting, and ing

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

How to Create a PDF. Using Acrobat Distiller. Acrobat Distiller settings. Adobe Acrobat Professional 8.0 Guide

Purpose: This chapter demonstrates how to create pie charts, and discusses some of the issues to consider when deciding whether to use a pie chart.

Fiery Driver for Windows

CHAPTER 1 Introduction to SAS/GRAPH Software

The GANNO Procedure. Overview CHAPTER 12

NEW FEATURES IN FOUNDATION SAS 9.4 CYNTHIA JOHNSON CUSTOMER LOYALTY

PdfBatch : User GuideV3.1. Manipulate your PDF files quickly. PdfBatch 3.0 allows you to manipulate Adobe Acrobat Portable Document Format.

ADDITIONAL RECOMMENDED STANDARDS FOR DRS DEPOSIT:

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

Exporting SAS/GRAPH to Other Packages What Format Should I Choose? (Version 6 of the SAS System)

Quick Reference Card Business Objects Toolbar Design Mode

PDF Ebook Preparation & Submission Guidelines

MODULE 4: DESIGN CONSIDERATIONS. Module Overview. Objectives

ODS and Web Enabled Device Drivers: Displaying and Controlling Large Numbers of Graphs. Arthur L. Carpenter and Richard O. Smith Data Explorations

4D Write. User Reference Mac OS and Windows Versions. 4D Write D SA/4D, Inc. All Rights reserved.

Quick Results with the Output Delivery System

Interactive Graphs from the SAS System

ABC s of Graphs in Version 8 Caroline Bahler, Meridian Software, Inc.

Chapter 1 Introduction. Chapter Contents

How to Prepare a Digital Edition PDF Book With Microsoft Word

Picturing Statistics Diana Suhr, University of Northern Colorado

Usinq the VBAR and BBAR statements and the TEMPLATE Facility to Create side-by-side, Horizontal Bar Charts with Shared Vertical Axes Labels

Routing Output. Producing Output with SAS Software CHAPTER 6

Generally, typefaces with the Euro currency symbol are available in TrueType and PostScript formats for PC, as well as in PostScript format for MAC.

Help with PDF Files Is there a way someone else can do this for me? What Software Do I Need to Create PDF Files?

Text and Lists Use Styles. What Are Styles?

PDF Printing & Print Preview

About This Manual. How to use this operation manual. Symbols. Trademarks. Software copyright. Regarding this manual. Introduction

In this document, you will learn how to take a Microsoft Word Document and make it accessible and available as a PDF.

Creating PDF Documents with PHP

Developing a Dashboard to Aid in Effective Project Management

How to Prepare a Digital Edition PDF Book With Adobe InDesign

How to create a PDF document for Duplicating to print for you.

Creating Printed Output

File Preparation for Eagle Print. PLEASE NOTE:If you are an IBM based customer, we can only accept PDF files!

Submission Guideline Checklist

PDF Batch Stamp Tool. Version User Manual. Kasernenstrasse Bachenbülach Switzerland

Principles of Professional Communication 1!! Lecture 12! Graphics & Visuals a picture paints a thousand words!

Font Information Files for Bitstream Soft Fonts

A GUIDE TO QUARKXPRESS 4.06 BETA. pthe choice for publishing software worldwide.

DocuPrint C3055/C3055 DX PCL Emulation Setting Guide

Part 1. Introduction. Chapter 1 Why Use ODS? 3. Chapter 2 ODS Basics 13

PAGE LAYOUT CHAPTER X. In this session you will:

Excel Main Screen. Fundamental Concepts. General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Workbook

Press-Ready Cookbook Page Guidelines

Creating PDF documents including hyper-links, bookmarks and a table of contents with the SAS software. Lex Jansen NV Organon Oss, The Netherlands

FREEHAND PDF PROCEDURES

ICH M8 Expert Working Group. Specification for Submission Formats for ectd v1.1

Chapter One Modifying Your Fonts

OS/390 DASD I/O Drill Down Computer Performance Chart Using ODS SAS/GRAPH & MXG Software

Want Quick Results? An Introduction to SAS/GRAPH Software. Arthur L. Carpenter California Occidental Consultants

CSS.

The GTESTIT Procedure

BusinessObjects Frequently Asked Questions

Preview tab. The Preview tab is the default tab displayed when the pdffactory dialog box first appears. From here, you can:

TABLE OF CONTENTS PART I: BASIC MICROSOFT WORD TOOLS... 1 PAGE BREAKS... 1 SECTION BREAKS... 3 STYLES... 6 TABLE OF CONTENTS... 8

How to use styles, lists, columns and table of contents

PDF and Accessibility

ADOBE 9A Adobe Acrobat Professional 8.0 ACE.

Step-by-Step Guide to. Creating High Resolution Adobe Acrobat PDFs from your Desktop Applications

Using 3D PDF with MIL-STD-31000A BEST PRACTICES 3D PDF CONSORTIUM DRAFT VERSION 3 09/25/17

Introduction to SAS/GRAPH Statistical Graphics Procedures

Data Presentation. Paper

BOXOFT Image to PDF s allow you scans paper documents and automatically s them as PDF attachments using your existing software

Creating Population Tree Charts (Using SAS/GRAPH Software) Robert E. Allison, Jr. and Dr. Moon W. Suh College of Textiles, N. C.

Formatting Highly Detailed Reports: Eye-Friendly, Insight-Facilitating

Transcription:

TS-659: Exporting SAS/GRAPH Output to PDF Files from Release 8.2 and higher The Portable Document Format is a common format for storing text and graphics in a high-resolution document that retains the page layout when transmitted, viewed, and printed. The format was developed by Adobe Systems Incorporated and is based upon the Postscript printer language. The program most often used to view PDF files is Adobe s Acrobat Reader. Acrobat Reader can be downloaded for free from theacrobat Reader Download Site, http://www.adobe.com/acrobat/readstep.html. Acrobat Reader is available for Windows, Macintosh, Unix, Linux, and OS/2 platforms. From SAS/GRAPH Release 8.2 there are two basic methods for exporting graphs to PDF files: A. The native device drivers: PDF and PDFC B. The Universal Printer, PDF, in conjunction with the Output Delivery System: ODS PDF The native device driver method is useful for exporting output from a single procedure to a PDF document. To combine output from multiple procedures in the same document, the ODS PDF method is recommended. It is also possible to create PDF files indirectly by first generating postscript files from SAS and then converting them to the PDF format using software from Adobe called Acrobat Distiller or a product from Ghostgum called Ghostview. This document only discusses the direct methods for creating PDF files from SAS. A. The Native Device Drivers: PDF and PDFC Two SAS/GRAPH device drivers, PDF and PDFC, can be used to create PDF documents from a single graphics procedure. The PDF device driver produces monochrome output while the PDFC device driver generates color output. To export graphics using a graphics device driver, both a FILENAME statement and a GOPTIONS statement are required. These statements define the export format, the storage location, and the name of the file. For example: FILENAME output "myfile.pdf"; GOPTIONS RESET=ALL DEVICE=PDFC GSFNAME=output GSFMODE=REPLACE; /* Graphics procedure goes here */ RUN;QUIT; Parameters in italics can be modified. In this code, the FILENAME statement assigns the fileref OUTPUT to the location MYFILE.PDF. The syntax necessary for the filename may vary by operating system. The GOPTIONS statement sets the output format to color PDF using DEVICE=PDFC. The GOPTIONS statement also directs the output to the defined file location using the GSFNAME= parameter. It is always a good practice to include the QUIT; statement after the last RUN; statement when exporting SAS/GRAPH output to graphics files.

1. Fonts It is recommend that a hardware font, one native to the PDF format, be used to generate the output. Because the PDF format is based upon the Postscript language, any postscript font can be used in the PDF file. However, because the fonts are not embedded in the PDF file, only text created using fonts installed with the program viewing the file will be rendered in the same font. Font substitutions can occur with any font the viewing software does not recognize. Acrobat Reader, for instance, only includes the Base 14 postscript fonts with its default installation. The PDF and PDFC device drivers include these same 14 Postscript fonts. The names of these fonts as they are used with these device drivers are listed in the table below. The Base 14 Fonts with the PDF/PDFC Device Driver Courier Helvetica Times-Roman Symbol Courier-Oblique Helvetica-Oblique Times-Italic ZapfDingbats Courier-Bold Helvetica-Bold Times-Bold Courier-BoldOblique Helvetica-BoldOblique Times-BoldItalic Font names are not case sensitive but they must be referenced in quotes. Note: If you have an existing program that references these fonts using their hardware names, such as HWPDF001 for the Courier font, these names are still honored in Release 8.2. 2. Examples There are three common methods for producing output using the native PDF and PDFC device drivers. These include: a. One graph from one procedure b. Multiple graphs from one procedure using a BY statement c. Multiple graphs from one procedure using RUN-group processing Each method is demonstrated in an example below. The following data is used in all examples in this document. The output from this data may vary in appearance as the summary values are calculated randomly. data sample; length Season Region $12.; do Season= Spring, Summer, Fall, Winter ; do Region= North, East, South, Central, West ; Sales=ceil(ranuni(0)*10); output; end; end; run;

a. Producing one graph from one procedure goptions reset=all ftext="helvetica-bold" htext=16pt dev=pdfc gsfname=output gsfmode=replace; filename output pie.pdf ; pattern1 value=solid color=cx994477; pattern2 value=solid color=cx997744; pattern3 value=solid color=cx449977; pattern4 value=solid color=cx447799; pattern5 value=solid color=cx774499; pie region / sumvar=sales coutline=black percent=inside value=none slice=outside midpoints="north" "East" "Central" "West" "South"; This program generates a PDF file named PIE.PDF that has one page and one graph in it, a pie chart. The Helvetica-Bold font is used for all the text. Note: the different pages in the PDF files generated by the code are represented in this document as separate JPEG screenshots, not the actual pages in the PDF files. Images are not to scale. Snapshot of the PIE.PDF file

b. Producing multiple graphs from one procedure using a BY statement goptions reset=all ftext="helvetica-bold" htext=16pt hby=0 dev=pdfc gsfname=output gsfmode=replace; filename output bypie.pdf ; pattern1 value=solid color=cx994477; pattern2 value=solid color=cx997744; pattern3 value=solid color=cx449977; pattern4 value=solid color=cx447799; pattern5 value=solid color=cx774499; proc sort data=sample; by season; run; title1 height=22pt "#byval1 Sales by Region"; by season; pie region / sumvar=sales coutline=black noheading percent=inside value=none slice=outside midpoints="north" "East" "Central" "West" "South"; This program generates a PDF file named BYPIE.PDF that has four pages with one pie chart on each page. The Helvetica-Bold font is used for all text in the document.

Snapshots of Pages 1-4 of the BYPIE.PDF file

c. Producing multiple graphs from one procedure using RUN-group processing goptions reset=all ftext="helvetica-bold" htext=16pt hby=0 dev=pdfc gsfname=output gsfmode=replace; filename output multirun.pdf ; pattern1 value=solid color=cx99ff99; pattern2 value=solid color=cxffcc33; pattern3 value=solid color=cxaa3311; pattern4 value=solid color=cx99ccff; where Region in("north" "East"); title1 North and East Regions ; axis1 order=("north" "East"); hbar season / sumvar=sales patternid=midpoint width=5 group=region nostats gaxis=axis1 midpoints="spring" "Summer" "Fall" "Winter"; run; where Region in("central" "West" "South"); title1 Central, South, and West Regions ; axis1 order=("central" "South" "West"); hbar season / sumvar=sales patternid=midpoint width=5 group=region nostats midpoints="spring" "Summer" "Fall" "Winter"; run; quit; This program generates a PDF file named MULTIRUN.PDF that has two pages with one bar chart on each page. The Helvetica-Bold font is used for all the text in the document.

Snapshot of Pages 1-2 of the MULTIRUN.PDF file B. The ODS PDF Destination As stated previously, the ODS PDF destination can be useful for storing the output from multiple procedures in the same PDF file. Once the ODS PDF destination is open, all procedure output, including output from text procedures, is directed to the document. By default each table or graph is written to a separate page in the document. The basic code necessary to generate a PDF file with this method is as follows: ODS PDF FILE="filename.pdf"; /* Procedures go here */ RUN;QUIT; ODS PDF CLOSE; Parameters in italics can be modified. The FILE= parameter can point to a predefined file reference or directly to a file. In the above example, all the procedural output is written to the file FILENAME.PDF. It is important to include the RUN; and QUIT; statements before terminating the destination with the ODS PDF CLOSE; statement. Otherwise the output from the last procedure may not be included in the document. Before creating output to the ODS PDF destination, it is recommended that the ODS LISTING destination be closed. This step prevents extra copies of the output from being created. The statements to control the ODS

LISTING destination are included with the examples. 1. Fonts The fonts available with the ODS PDF destination are listed in the SAS Registry under the [CORE\PRINTING\PRINTERS\PSL\FONT FAMILIES] key. Remember that, because the fonts are not embedded in the PDF file, only the fonts installed with the Reader will be rendered correctly. Therefore it is recommended that the Base 14 fonts, those included with the default installation of Reader, be typically used. The names of these 14 fonts to use with the ODS PDF destination are given in the table below. The Base 14 Fonts with the Universal PDF Printers Courier Helvetica Times Symbol Courier/oblique Helvetica/oblique Times/italic ITC Zapf Dingbats Courier/bold Helvetica/bold Times/bold Courier/bold/oblique Helvetica/bold/oblique Times/bold/italic Font names must be enclosed in quotes but they are not case sensitive. The parameters listed after the slashes may come in any order. Notice that these names vary from the font list given with the PDF and PDFC device drivers. 2. ODS PDF Parameters and Options Using the ODS PDF method also gives you control over other aspects of the PDF document, including document information, the table of contents (aka "bookmarks"), and greater control over the page layout. The supported parameters are specified as follows: OPTIONS ORIENTATION=value PAPERSIZE=value LEFTMARGIN=value RIGHTMARGIN=value TOPMARGIN=value BOTTOMMARGIN=value; ODS PDF FILE="filename.pdf" AUTHOR="value" KEYWORDS="value" SUBJECT="value" TITLE="value" STARTPAGE=value; ODS PROCLABEL="value"; /* Procedure goes here */ RUN;QUIT; ODS PDF CLOSE; Statements in italics can be modified. The OPTIONS statement must precede the first ODS PDF statement in order for the settings to take effect in the document. These options will remain in effect throughout the entire document. Each parameter and option is described below.

a. Parameters that write document information These parameters provide general information about the document. They should be specified on the first ODS PDF statement that designates the FILE that is created. The values of these parameters can be viewed in the "General" section of the "Document Info" dialog. AUTHOR="name" KEYWORDS="word1 word2 <wordlist>" SUBJECT="subject" TITLE="title" b. Parameters that control the bookmarks Each procedure that writes output to the PDF file creates bookmarks including headings that describe the procedure and subheadings that describe the graphs or tables created by the procedure. These bookmarks can be used to easily navigate to different sections of the document. ODS PROCLABEL="text" Lets you change the label used for the procedure (bookmark heading). Graph descriptions (bookmark subheadings) can be controlled using the DESCRIPTION= option within the graphics procedure. c. Parameters and options that affect page layout STARTPAGE=<NOW/NO/NEVER> This parameter is used on the ODS PDF statement to control pagination in the file. The values are as follows: n NOW: Insert a page break after each output or graph. This is the default. n NO: Keep output from multiple text procedures on the same page. n NEVER: Keep output from multiple text and graphics procedures on the same page. The STARTPAGE parameter can be used in conjunction with the GOPTIONS HSIZE, HORIGIN, VSIZE, and VORIGIN to place multiple graphs or combine graphs and text output on a single page. ORIENTATION=<PORTRAIT/LANDSCAPE> This option controls the page orientation. The default is portrait. The same orientation must be used throughout the entire document. PAPERSIZE=<LETTER/LEGAL/ISOA4> Controls the size of the page. The default is usually letter. LEFTMARGIN= RIGHTMARGIN= TOPMARGIN= BOTTOMMARGIN= Each of these parameters sets a margin size for the page. Sizes such as "1 in", "1 cm", etc, can be specified for each margin. The default unit is inches.

3. Examples Two examples are given below for generating graphics to the ODS PDF destination. The first creates a twopage PDF file using two GCHART procedures. Parameters are included to control the bookmark values. The second example creates a one-page PDF file using four GCHART procedures and the STARTPAGE= option. A different ORIENTATION is used for each example. a. Producing a multi-page PDF file using multiple procedures /***Using the ODS PDF destination to create output ***/ options orientation=landscape; goptions reset=all ftext="times"; pattern1 value=solid color=cx994477; pattern2 value=solid color=cx997744; pattern3 value=solid color=cx449977; pattern4 value=solid color=cx447799; pattern5 value=solid color=cx774499; ods listing close; ods pdf file= vbar.pdf ; ods proclabel="sales Charts"; title1 Summer and Winter Sales ; where season in( Summer Winter ); vbar3d region / sumvar=sales discrete group=season patternid=midpoint cframe=cxe0e0e0 description="summer and Winter" midpoints="north" "East" "Central" "West" "South"; ods proclabel="sales Charts"; title1 Spring and Fall Sales ; where season in( Spring Fall ); vbar3d region / sumvar=sales discrete group=season patternid=midpoint cframe=cxe0e0e0 description="spring and Fall" midpoints="north" "East" "Central" "West" "South"; ods pdf close; ods listing; This code generates a two-page PDF file named VBAR.PDF. Each page contains one vertical bar chart. The Times font is used for all the text in the output. The following bookmarks are produced in the file: Each bookmark would navigate to the corresponding page in the file.

Snapshot of Pages 1-2 of the VBAR.PDF file

b. Producing a one-page PDF file containing multiple graphs from multiple procedures /*** Using the STARTPAGE option to place multiple graphs on a page ***/ options orientation=portrait; goptions reset=all ftext="courier/oblique"; ods listing close; ods pdf file="fourvbars.pdf" startpage=never; goptions hsize=0 vsize=0; axis1 order=(0 to 10); proc gslide; title1 Sales by Region and Quarter lspace=.5in; goptions horigin=0 vorigin=5 hsize=4 vsize=4; title1 Spring ; pattern1 value=solid color=cx99ff99; where Season= Spring ; vbar Region / sumvar=sales discrete coutline=black raxis=axis1; goptions horigin=4 vorigin=5; title1 Summer ; pattern1 value=solid color=cxffcc33; where Season= Summer ; vbar Region / sumvar=sales discrete coutline=black raxis=axis1; goptions horigin=0 vorigin=0; title1 Fall ; pattern1 value=solid color=cxaa3311; where Season= Fall ; vbar Region / sumvar=sales discrete coutline=black raxis=axis1; goptions horigin=4 vorigin=0; title1 Winter ; pattern1 value=solid color=cx99ccff; where Season= Winter ; vbar Region / sumvar=sales discrete coutline=black raxis=axis1; ods pdf close; ods listing; This code combines four graphs in one PDF file named FOURVBARS.PDF. The STARTPAGE=NEVER parameter keeps all the output on one page. Each graph is positioned on the page using the HORIGIN and VORIGIN parameters on the GOPTIONS statement. The size of each graph is also set on the GOPTIONS statement using the HSIZE and VSIZE parameters. The first graph, the GSLIDE, creates the common title over all the graphs. The LSPACE parameter on the TITLE statement inserts a linespace above the title. The Courier/oblique font is used for all the text in the output.

Snapshot of the FOURVBARS.PDF file Modified 9/11/01