The PREIMAGE attribute is ignored in ODS RTF output when you use the new inline formatting syntax


The image that you insert using the new inline formatting syntax in a TITLE or TEXT= statement might be missing from the RTF file. Inline formattingĀ enhancements were made in SASĀ® 9.2 to support nested styles. The example code below illustrates the problem, if you use a valid path and image name.

ods rtf file='c:\temp\test1.rtf';

title j=l "~{style[preimage = 'logo.jpg']}";
proc print data=sashelp.class;
run;

ods rtf close;

A workaround is to use the former inline formatting syntax. The example below uses the former inline formatting style and displays the image in the RTF file.

ods rtf file='c:\temp\test1.rtf';

title j=l "~S={preimage = 'logo.jpg'}";
proc print data=sashelp.class;
run;

ods rtf close;

If you are unsure whether you are running into this problem, you can route the output to ODS TAGSETS.RTF, PDF, or HTML output. If the image appears in the destination but not in the RTF destination, you are most likely experiencing this issue. Change the inline formatting syntax as shown in the workaround above to display the image in the RTF destination.