BookmarkSubscribeRSS Feed
Lex_SAS
SAS Employee
Is it possible to create links with ODS PDF that would link to page x in an already existing PDF file ?

Thanks,

Lex Jansen
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
I don't know about linking to a particular page number. If there's a way to do it, that might be possible with Adobe Acrobat adding something to an existing PDF file.

With ODS, you can use ANCHOR= and LINK= to do "internal" links. This code:
[pre]
proc sort data=sashelp.shoes out=shoes;
by Region;
where Region contains 'Europe';
run;

ods pdf file='c:\temp\anchor.pdf' anchor='Eur1';
proc print data=shoes;
by Region;
title 'European Report';
footnote link='#Eur1' 'Back To Top';
footnote2 link="http://www.setgame.com" "Play a Game Instead";
run;
ods pdf close;
[/pre]
sets the starting ANCHOR (or named section) to #Eur1 (instead of #IDX -- which is the default). So in that case, with a LINK= for #Eur1, PDF navigation will take you back to the section named at the top of the file. To the extent that you can say that every by group starts a new page, then #Eur1 would take you to the first named section, then #Eur2 would take you to the second named section -- which may or may not be the second page. Compare this to the regular behavior of LINK= in the footnote, which will take you outside the document to a web site (assuming you have network connectivity).

This (ANCHOR=) may NOT work in all versions of Acrobat Reader. ANCHOR= in HTML makes a named section using HTML tags. ANCHOR= works a bit differently for RTF and PDF. For RTF, there is a "bookmark" RTF control string that gets inserted into the document. For PDF, I'm not sure how ANCHOR= works behind the scenes.

cynthia
deleted_user
Not applicable
I found the section above on PDF links seemingly useful but then when I used it in my application I found that it does not work.

ods pdf file='c:\temp\anchor.pdf' anchor='Class1';
proc gchart data=sashelp.class;
title 'Student Information';
vbar age / discrete des='Age';
vbar sex / discrete des='Sex';
footnote link='#Class1' 'Back To Top';
run;
quit;
ods pdf close;

this code is similar to what has been done above but using proc gchart rather than proc print. When running this code notice that the links on the PDF do not display with the hyperlink boxes around them as they do in the previous example. Is the syntax different for procs gchart/gplot as compared to proc print? Is there a way to use links within procs gchart/gplot? And lastly, if there is a way to link in gchart, is there a way to link between pages such that the Age chart would have a link to the Sex chart?

Thanks as always.
Johnny
Cynthia_sas
SAS Super FREQ
Hi:
I do not believe that LINK= is supported in SAS/Graph procedures. That is something you could check with Tech Support.

cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1295 views
  • 0 likes
  • 3 in conversation