Hello,
I have three questions about the PDF bookmarks generated by RWI table.
I created a sample below. Thanks in advance!
ods pdf file="test.pdf";
title1 j=c "Sample of Class";
ods proclabel="Bookmark 1";
proc sort data=sashelp.class out=class;
by sex;
run;
data _null_;
set class end=eof;
by sex;
if _N_ = 1 then do;
dcl odsout o();
end;
if first.sex then do;
if SEX = 'F' then do;
o.table_start(label: 'Sex=F, keep it in bookmark');
end;
else do;
o.table_start(label: "Sex=M, don't show in bookmark");
end;
end;
o.row_start();
o.format_cell(data: Name ||' ' ||SEX);
o.row_end();
if last.sex then do;
o.table_end();
end;
if eof then do;
o.table_end();
end;
run;
ods proclabel="Can I move the following bookmarks under Bookmark 1?";
data _null_;
set class end=eof;
by sex;
if _N_ = 1 then do;
dcl odsout o();
end;
if first.sex then do;
if SEX = 'F' then do;
o.table_start(label: 'Sex=F, keep it in bookmark');
end;
else do;
o.table_start(label: "Sex=M, don't show in bookmark");
end;
end;
o.row_start();
o.format_cell(data: Name ||' ' ||SEX);
o.row_end();
if last.sex then do;
o.table_end();
end;
if eof then do;
o.table_end();
end;
run;
ods pdf close;
ods listing;
The original bookmark of sample as
The original sample bookmark
The bookmarks sample if the question 1 can be solved
The sample bookmark after question 2 be solved.
And finally the bookmark looks like
Have you tried using Java Script functions?
Thank you!
I noticed that paper. I can modify the bookmark using js, ghostscript or other tools after the PDF is created. However, I want to find if it can be down in SAS itself other than through third party solution because my PDF generated through SAS intrnet.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.