The SAS Output Delivery System and reporting techniques

Problem with bookmarks in ODS PDF

Reply
SAS Employee
Posts: 2

Problem with bookmarks in ODS PDF

When I execute the below code, it gives me the required output in pdf, however I get some unwanted bookmarks like “FilePrint”.
Is there any way, I can get rid of these additional bookmarks?

Any help is appreciated.

--Thanks

ods escapechar="~";

proc template;
define table foo;
column text ;
style={frame=void};
define text;
print_headers = off;
end;run;


title ;



ods pdf file="C:\pngconvert.pdf" bookmarklist=show bookmarkgen=yes;

ods proclabel = "Test";
%let text=~{style [just=c font_weight=bold font_size=14pt] Test };
/**/
data _null_ ;
file print ods =(template="foo");
description="";
length text $100;
text = "&text";
put _ods_;
run;

ods pdf close;
SAS Super FREQ
Posts: 8,743

Re: Problem with bookmarks in ODS PDF

Hi:
ODS creates a "node" or label for every major creation point of a document. So when the DATA step starts, you get a node for the beginning of the data step program -- that is the node label that gets changed by the ODS PROCLABEL statement.

The next major creation point is when the template gets called and bound to some data. Without any other instruction from you, that node is labelled FilePrint, FilePrint2, FilePrint3, etc. You can change or eliminate the name on that node in the SAS Results Window and in the PDF TOC as shown below. Note that the PDF TOC will not show the second level node at all, while the SAS Results Window will still show the object, but with the object name. This is not a big deal, because the node in the PDF TOC is gone and the ODS PROCLABEL text is what appears.

cynthia
[pre]
ods escapechar="~";
ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);
proc template;
define table foo;
column text ;
style={frame=void};
define text;
print_headers = off;
end;
end;
run;

title ;

ods listing close;
ods pdf file="C:\temp\pngconvert4.pdf" bookmarklist=show bookmarkgen=yes;

ods proclabel = "Test";
%let text=~{style [just=c font_weight=bold font_size=14pt] Twas brillig and the slithy toves };
/**/
data _null_ ;
file print ods =(template="foo"
object=wombat
objectlabel="ObjectLabel");
description="";
length text $200;
text = "&text";
put _ods_;
run;

ods proclabel = 'The Second Output';
%let text=~{style [just=c font_weight=bold font_size=14pt] Did gyre and gimble in the wabe };
/**/
data _null_ ;
file print ods =(template="foo"
object=koala
objectlabel=" "); /* quote space quote */
description="";
length text $200;
text = "&text";
put _ods_;
run;

ods pdf close;

[/pre]
SAS Employee
Posts: 2

Re: Problem with bookmarks in ODS PDF

Thanks, it worked out.
Ask a Question
Discussion stats
  • 2 replies
  • 163 views
  • 0 likes
  • 2 in conversation