Is it possible to import a PNG file into SAS to include in RTF output?

前端 未结 1 1284
面向向阳花
面向向阳花 2020-12-21 18:13

I have PNG files that were created outside of SAS that I would like to include in an RTF file that I will output from SAS using ODS. Is it possible to use SAS to do this?

相关标签:
1条回答
  • 2020-12-21 18:23

    ODS RTF: The Basics And Beyond, is certainly relevant. Here's an example of doing this in body text not using the title.

    ods rtf file="c:\temp\test.rtf" startpage=never;
    ods escapechar='^';
    proc print data=sashelp.class;
    run;
    ods text='^S={preimage="C:\temp\SGPlot.jpeg" just=c}';
    proc print data=sashelp.class;
    run;
    ods rtf close;
    

    That's using a random SGPLOT I had laying around, but of course you can use whatever you prefer. I added startpage=never to have it put things on the same page - but of course that's optional (otherwise it'll put the image on its own page in my example).

    The important thing is the ods text (which puts some text, normally), the ods escapechar (which sets ^ to be the escape character), and then ^S={ } which is how you insert styles and similar things in RTF (and other destinations). Then we just use preimage which means put an image before the next bit (the text, which is blank here). You could just as easily have put this in the title statement, rather than ods text, if that's where you want the image.

    0 讨论(0)
提交回复
热议问题