是否可以将 PNG 文件导入 SAS 以包含在 RTF 输出中? [英] Is it possible to import a PNG file into SAS to include in RTF output?

查看:71
本文介绍了是否可以将 PNG 文件导入 SAS 以包含在 RTF 输出中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在 SAS 之外创建的 PNG 文件,我想将这些文件包含在我将使用 ODS 从 SAS 输出的 RTF 文件中.是否可以使用 SAS 来做到这一点?我的互联网搜索出现了很多不相关的结果.

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? My internet searches are turning up a lot of irrelevant results.

推荐答案

ODS RTF:基础和超越,当然是相关的.这是在不使用标题的正文中执行此操作的示例.

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;

那是使用我随意放置的 SGPLOT,当然你可以使用任何你喜欢的.我添加了 startpage=never 让它把东西放在同一个页面上 - 但当然这是可选的(否则在我的例子中它会将图像放在自己的页面上).

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).

重要的是 ods text(通常放置一些文本),ods escapechar(将 ^ 设置为转义字符),然后是 ^S={ } 这是您在 RTF(和其他目标)中插入样式和类似内容的方式.然后我们只使用 preimage 这意味着在下一位之前放一张图片(文本,这里是空白的).如果这是您想要图像的位置,您可以轻松地将其放在 title 语句中,而不是 ods text.

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.

这篇关于是否可以将 PNG 文件导入 SAS 以包含在 RTF 输出中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆