ODS PDF does not display a URL when inline style functions are used


The URL style attribute enables you to insert a URL within text in the non-Listing ODS destinations. In the PDF destination, the URL style attribute must be the first style attribute that is specified in the string of a cell, whether the cell is created by TEXT=, a TITLE statement, a FOOTNOTE statement, or in data. Please note that only one URL is permitted per cell.

The Full Code section below illustrates sample code in which the URL style attribute is specified first.


Full Code

Because the URL attribute must be first, the following code creates a URL of the entire paragraph, but uses inline style commands to underline just the text "SAS Customer Support Site". Note the use of the CELLHEIGHT attribute to increase the height of the row, which allows the underline to be displayed. Both syntax methods for using inline style functions are used in the sample code: '^S={ }' and '^{style [ ]}'. 

options orientation=portrait nodate nonumber;
title;
footnote;

ods escapechar="^";

ods pdf file="file.pdf" notoc;

proc odstext;
  p "^S={URL='http://support.sas.com' linkcolor=white}Here's a URL link to the ^S={color=blue textdecoration=underline}SAS Customer Support site^S={}.Check it out!" 
    / style={just=c cellheight=14pt};
run;

proc odstext;
  p "^{style [url='http://support.sas.com' linkcolor=white]Here's a URL link to the ^{style [color=blue textdecoration=underline]SAS Customer Support site}}.Check it out!" 
    / style={just=c cellheight=14pt};
run;

ods _all_ close;


Output

Click file.pdf to view output.