New ODS PRINTER features for SAS 9.1
New fixed escape sequence
The new
(*ESC*) sequence will act as an escape character even
when ODS ESCAPECHAR is not set. Thus, it acts like '03'x in being
always available. The advantage over '03'x is that it works in any
context, not just in string-
expression contexts.
Thus, it's fair game for use in style attributes.
See
example code
under Ability to generate contents list.
You can now move page numbers and dates around in the "obvious" way, by
setting the JUST= and VJUST= attributes in the style elements that
control them; for example:
style PageNo from TitleAndFooters /
Font = fonts("strongfont")
pretext = "--" posttext = "--"
cellpadding=0 cellspacing=0
just=c vjust=b
;
style BodyDate from Date /
just=l vjust=t
;
Page i of n support
All in-line formatting continues to be experimental in SAS 9.1.
The development team is adding new functions
while they work toward a production-level product.
New for SAS 9.1 is the experimental in-line formatting function {LASTPAGE},
which provides the page count in PRINTER destinations when output does not contain images.
Note that this is not necessarily the page number of the
last page; use of the PAGENO option can make
it differ. It is intended to be used mostly like this:
ods escapechar='^';
proc template;
define style styles.pageof; parent = styles.printer;
Style PageNo from TitlesAndFooters /
font = fonts("strongFont")
cellpadding = 0 cellspacing = 0
pretext = "Page "
posttext = " of ^{lastpage}"
;
end;
run;
Improved color/background options
The original COLOR/NOCOLOR options were confusing. COLOR controlled
both the default SAS/GRAPH device
and the printing of
background colors in cells and pages and such. For the sake of
compatibility these will still be honored, but we are breaking them up
into more specific options:
- COLOR=FULL
- Full-color graphs (default).
- COLOR=GRAY
- Grayscale graphs.
Alias: COLOR=GREY.
- COLOR=MONO
- Monocolor graphs.
Alias: COLOR=BW.
- NOBACKGROUND
- Suppress the printing of background colors
in text.
The old NOCOLOR option is equivalent to COLOR=GRAY NOBACKGROUND and now
COLOR is COLOR=FULL BACKGROUND.
Improved Table of Contents options
The old NOTOC option was confusing and there was no TOC to do the
opposite; plus it turned off bookmark generation as well as the list of
bookmarks. (That part is a bug.)
Also, there was no support for a "real," printable table of contents,
such as you'd find in a book. Now there is.
- CONTENTS
- Generate a printable table of contents, like one
you'd get in a book. This is a new feature.
Alias: CONTENTS=YES/ON.
- NOCONTENTS
- Do not generate a printable table of contents.
Default.
Alias: CONTENTS=NO/OFF.
- BOOKMARKLIST=
- Control whether or not to generate and/or
display the list of bookmarks for the PDF file. This option can only be
set when initializing the destination; it cannot be reset later.
It has three possible values:
- BOOKMARKLIST=SHOW/YES/ON
- Generate a list of bookmarks for PDF.
Automatically displays the bookmarks when bringing up the PDF file.
Default.
Alias: BOOKMARKLIST
- BOOKMARKLIST=NONE/NO/OFF
- Do not generate the list of
bookmarks for PDF. The generation of the bookmarks themselves
(the "anchors") is not affected by the setting of this option, but is
rather controlled by BOOKMARKGEN.
Alias: NOBOOKMARKLIST
- BOOKMARKLIST=HIDE
- Go ahead and generate the bookmark
list but do not display it by default. Normally, when ODS PRINTER
generates the bookmark list it also sets a flag to tell Adobe Acrobat
Reader to display the bookmarks when it initially displays the file.
Whether you use BOOKMARKLIST=HIDE or BOOKMARKLIST=SHOW, the list is
still generated and can be displayed or hidden using icons in Adobe
Acrobat reader; the difference between HIDE and SHOW is just whether it
is initially displayed.
- BOOKMARKGEN
- Generate the bookmarks themselves. This is the
default state, and since there is no registry entry to alter that
default, only the negative form of this option serves any useful purpose.
We had once hoped to be able to turn the generation on and off during
the lifetime of the document, but that feature was dropped when it
turned out to be harder to implement than we thought, since the
perceived benefit of such a feature seems marginal in the first place.
Alias: BOOKMARKGEN=YES/ON
- NOBOOKMARKGEN
- Do not generate the default bookmark entries,
thus omitting them from the bookmark list, among other places. This
option automatically turns off BOOKMARKLIST since the list would
otherwise be empty when this option was used.
Alias: BOOKMARKGEN=NO/OFF
Caution: Bookmarks are
used not only for the bookmark list, but also for the CONTENTS list and
for external entries (such as URL=), so be careful with the use of this
option.
The existing NOTOC command means NOCONTENTS NOBOOKMARKS.
Also note that I am adding the BOOKMARK= alias for the ANCHOR= option.
This should make more sense to everybody since Acrobat calls these
things "bookmarks." The previous alias (which we are not discarding)
was NAMED_DEST, which is the internal PDF name but is not
known to most users.
Ability to generate contents list
The table of contents is produced with the new CONTENTS= option (see
above). To control the appearance of the table of contents, use the following
style elements:
- ContentTitle
- PreText is used for the title; other attributes control
the appearance of the title.
- PrintedContentsLabel
- PreText and PostText supply the indention and
leaders for the table of contents. Effectively wrapped "around" the
following:
-
ContentItem, ContentFolder, ContentProcName, ContentProcLabel
-
formatting of the contents strings themselves.
And these in-line functions can be used only in content lists:
- ^{tocentryindent <len>}
- Tells the amount to indent per level.
- ^{tocentrypage}
- Page number of the current TOC entry.
Typical usage:
Replace PrintedContentsLabel "Wrapper for the CONTENTS" /
PreText = "(*ESC*){tocentryindent 2em}"
PostText = " (*ESC*){leaders . }(*ESC*){tocentrypage}"
;
Leader function
- ^{leaders <string>}
- Produces leaders; that is, it
repeats the string so as to fill up the remainder of the line between
the leader and the text following it. Typically used in tables of
contents.
ODS PRINTER now supports NEWFILE= just like the other ODS destinations.
Experimental for SAS 9.1, but seems to work pretty well.