Previous Page | Next Page

Dictionary of ODS Language Statements

ODS PDF Statement



Opens, manages, or closes the PDF destination, which produces PDF output, a form of output that is read by Adobe Acrobat and other applications.
Valid: anywhere
Category: ODS: Third-Party Formatted
Tip: The PDF driver that SAS uses does not recognize all Microsoft Windows fonts. You must enter any such fonts into the SAS registry in order for SAS to find them. See the SAS registry information in SAS Language Reference: Concepts.

Syntax
Without an Action or Options
Actions
Options
Details
The ODS Printer Family of Statements
Opening and Closing the PDF Destination
Examples
Example 1: Opening Multiple Instances of the Same Destination at the Same Time
See Also

Syntax

ODS PDF <(<ID=>identifier)> <action>;
ODS PDF <(<ID=>identifier)> <option(s)>;


Without an Action or Options

If you use the ODS PDF statement without an action or options, then it opens the PDF destination and creates PDF output.


Actions

The following table lists the actions available for ODS PDF statement. For complete descriptions see Actions in the ODS PRINTER statement.

ODS PDF Action Summary Table
Task Action
Close the PCL destination and the file that is associated with it CLOSE
Exclude output objects from the PCL destination EXCLUDE
Select output objects for the PCL destination SELECT
Write to the SAS log the current selection or exclusion list for the PCL destination SHOW


Options

The following table lists the options that are available for the ODS PDF statement. For more detailed descriptions of these options, see Options in the ODS PRINTER statement.

ODS PDF Option Summary Table
Task Option
Specify the root name for the anchor tag that identifies each output object in the current file ANCHOR=
Insert the text string that you specify as the author in the metadata of a file AUTHOR=
Specify a string to use as the first part of all references that ODS creates in the file BASE=
Specify whether to generate and display the list of bookmarks for a PDF file BOOKMARKLIST=
Control the generation of bookmarks in a PDF file BOOKMARKGEN=
Apply a specified color scheme to your output COLOR=
Specify the number of columns to create on each page of output COLUMNS=
Specify the compression of a PDF file. Compression reduces the size of the file COMPRESS=
Specify a cascading style sheet to apply to your output CSSSTYLE=
Specify the image resolution for output files DPI=
Specify the file to write to FILE=
Open multiple instances of the same destination at the same time ID=
Insert a string of keywords into the output file's metadata KEYWORDS=
Create a new file at the specified starting-point NEWFILE=
Specify that the output from the destination be added to an ODS package PACKAGE
Control whether notes are added to a PDF file for items that are associated with the FLYOVER= style attribute PDFNOTE
Control the level of the expansion of the table of contents in PDF documents PDFTOC=
Control page breaks STARTPAGE=
Specify the style definition to use in writing the PDF output STYLE=
Insert the text string that you specify as the subject in the metadata of a file SUBJECT=
Insert text into your output TEXT=
Insert the text string that you specify as the title in the metadata of a file TITLE=
For multi-page tables, provide uniformity from page to page within a single table UNIFORM


Details


The ODS Printer Family of Statements

The ODS PDF statement is part of the ODS printer family of statements. Statements in the printer family open the PCL, PDF, PRINTER, or PS destination, producing output that is suitable for a high-resolution printer. The ODS PCL, ODS PRINTER, and ODS PS statements are also members of the ODS printer family of statements.


Opening and Closing the PDF Destination

You can modify an open PDF destination with many ODS PDF options. However, the FILE= and SAS options will automatically close the open destination that is referred to in the ODS PDF statement, and will also close any files associated with it, and then open a new instance of the destination. If you use one of these options, it is best if you explicitly close the destination yourself.


Examples


Example 1: Opening Multiple Instances of the Same Destination at the Same Time

ODS features:

ODS PDF statement:

Options:

ID=

STYLE=

FILE=

Other SAS features:

PROC FORMAT

PROC SORT

PROC REPORT

NOBYLINE|BYLINE system option

#BYVAL parameter in titles

Data set:

Grain_Production .

Format:

$CNTRY. .

This example opens multiple instances of the PDF destination to create PDF output. One instance uses the default style definition and the second instance uses the STYLE= option to specify the D3D style definition.


Program

 Note about code
proc sort data=grain_production;
   by year country type;
run;
 Note about code
ods listing close;
 Note about code
ods pdf file='grain-1.pdf' pdftoc=2; 
ods pdf (id=brickstyle) style=brick file='grain-2.pdf' pdftoc=3;
 Note about code
options nobyline nodate;
title 'Leading Grain-Producing Countries';
title2 'for #byval(year)';
 Note about code
proc report data=grain_production nowindows;
   by year;
   column country type kilotons;
   define country  / group width=14 format=$cntry.;
   define type     / group 'Type of Grain';
   define kilotons / format=comma12.;
   footnote 'Measurements are in metric tons.';
run;
 Note about code
options byline;
title2;
 Note about code
proc tabulate data=grain_production format=comma12.;
   class year country type;
   var kilotons;
   table year, 
         country*type, 
         kilotons*sum=' ' / box=_page_ misstext='No data';
   format country $cntry.;
   footnote 'Measurements are in metric tons.';
run;
 Note about code
ods pdf close;
ods pdf(id=d3dstyle) close;

PDF Output

PDF Output With the Default Style Definition

[PDF Output With the Default Style Definition]

PDF Output Using Brick Style Definition

[PDF Output Using Brick Style Definition]


See Also

Statements:

ODS PCL Statement

ODS PRINTER Statement

ODS PS Statement

The Third-Party Formatted Destinations

Previous Page | Next Page | Top of Page