pdfmark

  • Follow


how do i control the number of lines in a table of contents that refer
to a bookmark. I keep getting 2 lines in the toc which link to the
same location.

The first line in the toc is just as I want it with the appropriate
proclabel.
The second line (which i am trying to eliminate) says "output from
proc gslide".

Also how can I control the nesting of bookmarks. i.e. if i have a proc
print and a proc means for the same customer i would like both lines
in the toc to be indented below the customer name.


Is there a good reference for pdfmark besides the "ods printer faq"
which is too brief.

here are the pertinent lines of sas code i am using. 

ods ps pdfmark file="&MEMB.F345.ps"  pdfnote toc;
ods proclabel "&bname";
ods ps anchor="&cseqnum";
0
Reply dguinn (3) 7/7/2003 9:49:55 PM

If you have SAS 8.2 the best way to control the bookmarks is with PROC
DOCUMENT, however, if you had SAS 8.2 you would probably be using the PDF
destination rather than ODS PS PDFMARK...

Also, your approach in SAS 8 - SAS 8.1 will depend on what PROCS YOU ARE
using...

SAS 8.2 or 9.0 example using PROC DOCUMENT (Andre take note!! :):


ods trace off;
ods document name=freqfix(write);
ods pdf file="C:\temp\Original freq.pdf" style=kdnewstyle;
ods proclabel "Highest bookmark";
proc freq data=sashelp.shoes;
   table region*product/missing contents="Lower level bookmark";
   run;
*ODS PDF CLOSE;

ods document close;

ods listing;
ods pdf exclude Properties;*Don't write the DOCUMENT output to our PDF;
proc document name=work.freqfix;run;
list/ details levels=all;run;

*Below Changes the Middle bookmark in PROC FREQ;
setlabel \Freq#1\Region_by_Product#1 "Distribution of Product's by Region";
obanote \Freq#1\Region_by_Product#1\CrossTabFreqs#1 ;
ods pdf exclude Properties;
list /details levels=all; run;
replay;
quit;

ods pdf exclude properties;
proc document name=work.freqfix;run;

copy \Freq#1\Region_by_Product#1\CrossTabFreqs#1 to \Freq#1;
run;
*This gets rid of an extra bookmark, probably what you want to do;
delete \Freq#1\Region_by_Product#1 ;
list  /details levels=all;
run;
replay;
quit;

ods pdf close;


For SAS V8+ (<8.2) you can change the bookmark labels, but it is not as
easy:

For PRINT, TABULATE, REPORT AND Multiway FREQS you can use CONTENTS=, for
other procs you need to modify their TABLE TEMPLATE, both techniques are
shown below:

*Use ODS PROCLABEL to modify Procedure level bookmarks;
ods pdf file="C:\documents and settings\khd8\desktop\Change the Procedure
(highest level) bookmarks.pdf" style=mynewstyle;
ods proclabel "Listing of sashelp.class data";
proc print data=sashelp.class (obs=5) contents="Only the first 5
observations";
var id age sex fastgluc;
run;
ods proclabel "Height and Weight Measures glucose Statistics";
Proc means data=sashelp.class n mean median min max;
var height Weight;
run;

Proc format; value high 0-120="OK" 120<-high="HIGH";
run;

ods proclabel "Distribution of gender, SASHelp.class data";
Proc freq data=sashelp.class ;
tables sex;
run;
ods pdf close;

*Edit the table templates for One way freqs and Summary(means);
proc template;

   edit Base.Freq.Onewaylist;
      mvar mylabel;
          contents_label= mylabel;

   end;
   edit base.summary;
          mvar mylabel;
          contents_label=mylabel;
        end;
run;


*Use the macro variable mylabel and ODS PROCLABEL To modify the bookmarks;
ods path SASuser.templat sashelp.tmplmst;
ods trace on;
ods pdf file="C:\temp\change procedure bookmarks.pdf" style=mynewstyle;
ods proclabel "Listing of sashelp.class data";
proc print data=sashelp.class (obs=5)contents="Only the first 5
observations";
var id age sex fastgluc;
run;
ods proclabel "HEIGHT and Weight Statistics";
%let mylabel=Mean Median Min and Max;
Proc means data=sashelp.class n mean median min max;
var Height Weight;
run;
ods proclabel "Distribution of gender, SASHELP.CLASS data";
%let mylabel=Percentage Male and Female;
Proc freq data=sashelp.class ;
tables sex;
run;
ods pdf close;
%let mylabel= ;
%let mylabl2=;
ods trace off;

There isn't an Easy way to Delete bookmarks without PROC DOCUMENT (there
isn't even a good hard way without modifying the PDF's themselves after the
fact...

This only sort of works:

proc format; value ages 0-29="<30" 30-high=">=30";
                        value weights 0-99="<100" 100-high=">=100";
                        value Height 0-<60="Less than 5'" 60-high="5 feet
+";
run;


ods Pdf  file="C:\temp\test.pdf" style=printer;

*Create a PDF With dummy bookmarks;
proc freq data=sasHelp.class;
*by age;
tables sex *Height/contents="Delete me";
tables age *height/contents="Delete me";
tables  weight*Height/contents="Delete me";
format age ages. weight weights. height height.;
run;

*Use DDE to blow them away!!!;

ods pdf close;
%let path=C:\temp\;

*Open word;
filename wordsys  dde "winword|system";
options noxsync noxwait noxmin;

data null;
length fid rc start stop time 8;
fid=fopen('wordsys','s');
if (fid le 0) then do;
rc=system('start winword');
start= datetime();
stop=start+10;
do while (fid le 0);
fid=fopen('wordsys','s');
time=datetime();
if (time ge stop) then fid=1; end;
end;
rc=fclose(fid);
run;

*We created three tables with extra bookmarks;
%let tablenum=3;
data _null_;
file wordsys;
put '[Fileopen .name="'"&path.test.pdf"'"]';*Open the file;
*Change a couple bookmarks, to show we can, not recommended, you should edit
the table templates;
put '[Editreplace .find="Table Weight * Height", .replace="Height, by
Weight",.replaceone,.wrap=1]';
put '[Editreplace .find="Table Age * Height", .replace="Height, by
Age",.replaceone, .wrap=1]';

*Go through and delete the extra bookmarks we don't need;
do i=1 to &tablenum;
put '[Editfind .find="Delete me", .direction=0, .wrap=1]';
put '[Editgoto .destination="l-2"]';
put '[Selectcursentence]';
put '[Linedown 6,1]';
put '[Editclear 1]';
end;
*This is based on how SAS currently writes PDF, which will probably change;
*It may take a little playing with to get it to work, and is more for fun
than a
        real solution;
put '[FileSave]';
put '[Fileclose]';
put '[Fileexit]';
run;


*******************************************;
So Moral of the story, if you don't have SAS 8.2 you are probably stuck
editing your PDF in Acrobat, unless you want to get really creative...

But with 8.2 Proc Document makes it pretty easy!!

Let me know if you have Questions,

Kevin
Kdelaney@cdc.gov


-----Original Message-----
From: j erickson [mailto:dguinn@TRISTATEGT.ORG]
Sent: Monday, July 07, 2003 5:50 PM
Subject: pdfmark


how do i control the number of lines in a table of contents that refer to a
bookmark. I keep getting 2 lines in the toc which link to the same location.

The first line in the toc is just as I want it with the appropriate
proclabel. The second line (which i am trying to eliminate) says "output
from proc gslide".

Also how can I control the nesting of bookmarks. i.e. if i have a proc print
and a proc means for the same customer i would like both lines in the toc to
be indented below the customer name.


Is there a good reference for pdfmark besides the "ods printer faq" which is
too brief.

here are the pertinent lines of sas code i am using.

ods ps pdfmark file="&MEMB.F345.ps"  pdfnote toc;
ods proclabel "&bname";
ods ps anchor="&cseqnum";
0
Reply khd8 (68) 7/8/2003 2:15:01 PM


1 Replies
51 Views

(page loaded in 0.049 seconds)

Similiar Articles:













7/20/2012 2:24:10 AM


Reply: