<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Control collapse of bookmarks in pdf in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713585#M220168</link>
    <description>&lt;P&gt;It is not easy to control PDF bookmarker in SAS .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you create PDF file ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=define_xml nowd split="*" &lt;STRONG&gt;contents=""&lt;/STRONG&gt; 
                     style(report)={outputwidth=100% rules=all}
                     style(header)={font_weight=bold} ;
	columns memname name label type length _id_;
                     define memname/display noprint;
					 define _id_/order noprint;
					 compute dictionary;
                      rtag = "#"||strip(name);
                      call define(_col_,"url",rtag);
                      call define(_col_,"style","style={foreground=blue}");
					  n+1;
                      if mod(n,2)=1 then call define(_row_,"style","style={background=verylightgrey}");
                     endcomp;
					 break before _id_/page &lt;STRONG&gt;contents=""&lt;/STRONG&gt;;
                   run;&lt;/PRE&gt;</description>
    <pubDate>Sat, 23 Jan 2021 11:11:20 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-01-23T11:11:20Z</dc:date>
    <item>
      <title>Control collapse of bookmarks in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713574#M220162</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there a way to control the collapse of bookmarks in a 3-level bookmarked pdf that is generated via ods pdf?&lt;/P&gt;&lt;P&gt;When generating a pdf I use pdftoc=1 to only show the first level bookmark when opening the pdf, but when I open the top-level bookmark it expands the second and third level bookmarks&amp;nbsp;simultaneously. Is it possible, when opening the top-level bookmark, only all second level bookmarks are showing and keep all third level bookmarks closed? I am looking for a solution directly involving the ods pdf destination or any other options within SAS and NOT for a solution that requires any "external" pdf software.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, when opening APPENDIX D,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swfouchier_0-1611386474787.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53825i8A94396281B6E0CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swfouchier_0-1611386474787.png" alt="swfouchier_0-1611386474787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;instead of getting:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swfouchier_1-1611386512004.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53826iA1CCB0AB29A8F5AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swfouchier_1-1611386512004.png" alt="swfouchier_1-1611386512004.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to get this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swfouchier_2-1611386553044.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53827iD4F01A9B181E2511/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swfouchier_2-1611386553044.png" alt="swfouchier_2-1611386553044.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 07:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713574#M220162</guid>
      <dc:creator>swfouchier</dc:creator>
      <dc:date>2021-01-23T07:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Control collapse of bookmarks in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713585#M220168</link>
      <description>&lt;P&gt;It is not easy to control PDF bookmarker in SAS .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you create PDF file ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=define_xml nowd split="*" &lt;STRONG&gt;contents=""&lt;/STRONG&gt; 
                     style(report)={outputwidth=100% rules=all}
                     style(header)={font_weight=bold} ;
	columns memname name label type length _id_;
                     define memname/display noprint;
					 define _id_/order noprint;
					 compute dictionary;
                      rtag = "#"||strip(name);
                      call define(_col_,"url",rtag);
                      call define(_col_,"style","style={foreground=blue}");
					  n+1;
                      if mod(n,2)=1 then call define(_row_,"style","style={background=verylightgrey}");
                     endcomp;
					 break before _id_/page &lt;STRONG&gt;contents=""&lt;/STRONG&gt;;
                   run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Jan 2021 11:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713585#M220168</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-01-23T11:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Control collapse of bookmarks in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713595#M220171</link>
      <description>&lt;P&gt;To control bookmarks I am using ods document.&lt;/P&gt;&lt;P&gt;First I have individual SAS program that can contain several proc report. My general set-up is similar to your code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods document name=items.section1(write);
title1 justify = left "Table 14.0.0.0";
ods proclabel = "Table 14.0.0.0";
proc report data = T14000 headline headskip nocenter nowindows missing contents="" split='~' style(header)=[just=right] 
                          style(column)=[just=right] style(report)=[cellpadding=0.8];
  columns pageno_ pageno sort1 grp1 trt1;
   define pageno_ / order order=internal noprint;
   define pageno  / order order=internal noprint;
   define sort1   / order order=internal noprint;
   define grp1    / style(column)=[cellwidth=1.9in just=left] "Protocol Deviation Term" style(header)=[just=left];
   define trt1    / style(column)=[cellwidth=1.3in];
  break before pageno_ / page contents="" ;
run;

title1 justify = left "Table 14.0.0.1";
ods proclabel = "Table 14.0.0.1";
proc report data = T14001 headline headskip nocenter nowindows missing contents="" split='~' style(header)=[just=right] 
                          style(column)=[just=right] style(report)=[cellpadding=0.8];
  columns pageno_ pageno sort1 grp1 trt1;
   define pageno_ / order order=internal noprint;
   define pageno  / order order=internal noprint;
   define sort1   / order order=internal noprint;
   define grp1    / style(column)=[cellwidth=1.9in just=left] "Protocol Deviation Term" style(header)=[just=left];
   define trt1    / style(column)=[cellwidth=1.3in];
  break before pageno_ / page contents="" ;
run;
ods document close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I do a proc document (update) to add a new level 1 bookmark, lets call it "Section 1" and place all proc reports (T14.0.0.0 and T14.0.0.1) underneath.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc document name=items.section1(update);
make section;
dir \ section#1;
setlabel \ section#1 "Section 1";
%macro loop;
  %local i table;
  %do i=1 %to %sysfunc(countw(&amp;amp;tables.));
    %let table = %scan(&amp;amp;tables., &amp;amp;i.);
    move \&amp;amp;table.#1 to ^;
  %end;
%mend loop;
%loop;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I create an in-between pdf for Section 1 to evaluate and validate results per section by re-running item section 1 within an ods pdf.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a final master pdf containing all sections, I first create a master item, in which all section items a replayed, followed by a proc document (update) to add the title "APPENDIX D"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods document name=items.masteritem(write);
%macro loop;
  %local i section;
  %do i=1 %to %sysfunc(countw(&amp;amp;sections.));
    %let section = %scan(&amp;amp;sections., &amp;amp;i.);
    proc document name=items.&amp;amp;section.(read);
    replay \&amp;amp;section.;
    run;
    quit;
  %end;
%mend loop;
%loop;
ods document close;&lt;BR /&gt;&lt;BR /&gt;proc document name=items.masteritem(update);&lt;BR /&gt;make master;&lt;BR /&gt;dir \ master#1;&lt;BR /&gt;setlabel \ master#1 "APPENDIX D";&lt;BR /&gt;%macro loop;&lt;BR /&gt;%local i section;&lt;BR /&gt;%do i=1 %to %sysfunc(countw(&amp;amp;sections.));&lt;BR /&gt;%let section = %scan(&amp;amp;sections., &amp;amp;i.);&lt;BR /&gt;move \&amp;amp;section.#1 to ^;&lt;BR /&gt;%end;&lt;BR /&gt;%mend loop;&lt;BR /&gt;%loop;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 12:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Control-collapse-of-bookmarks-in-pdf/m-p/713595#M220171</guid>
      <dc:creator>swfouchier</dc:creator>
      <dc:date>2021-01-23T12:47:52Z</dc:date>
    </item>
  </channel>
</rss>

