The SAS Output Delivery System and reporting techniques

ODS PDF Titles

Accepted Solution Solved
Reply
Super User
Posts: 18,990
Accepted Solution

ODS PDF Titles

I'm writing several tables to a PDF file and trying to get several on one page.

When I use the startpage=never or no options the titles don't get printed anymore in the document.

So a workaround is using ODS PDF Text= instead.

Is there a way to either

1. get the titles working in the output

2. Style the ODS PDF Text (ie Center, enlarge, add padding).

Thanks!


Accepted Solutions
Solution
‎01-03-2013 08:24 PM
SAS Super FREQ
Posts: 8,814

Re: ODS PDF Titles

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

View solution in original post


All Replies
Solution
‎01-03-2013 08:24 PM
SAS Super FREQ
Posts: 8,814

Re: ODS PDF Titles

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

Super User
Posts: 18,990

Re: ODS PDF Titles

Thanks Cynthia.

Is there a way to specify a header and footer in a PDF file across all pages? I have multiple tables going to the same page and sometimes they spill over to 2 or 3 pages, but I need the same header or footer on each page. 

SAS Super FREQ
Posts: 8,814

Re: ODS PDF Titles

Hi:

When I run the code below, using SAS 9.3, the SAS TITLE and FOOTNOTE statements specified at the beginning will repeat on all the pages of the output. However, I would expect that if you put different TITLE statements between your procedure steps you will get variable results with STARTPAGE=NO. But in the simplest usage, I do have the same title and footnote repeating across all pages.

cynthia

ods _all_ close;

 

ods pdf file='c:\temp\testtitle.pdf'

    startpage=no;

 

title 'Main Title';

footnote 'Main Footnote';

proc print data=sashelp.class;

run;

ods text= 'something1';

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

ods text= 'something2';

proc print data=sashelp.shoes(obs=50);

run;

ods text='something3';

 

ods pdf close;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 1521 views
  • 0 likes
  • 2 in conversation