From: Arthur Tabachneck on
SAS may well be able to do that, but I'm not aware of it having that
functionality. Conversely, this OLD response, from 1991, suggests an
alternative:

http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0109c&L=sas-l&F=&S=&P=1303

HTH,
Art
--------
On Thu, 4 Feb 2010 09:30:20 -0800, Satya <kondal4uall(a)GMAIL.COM> wrote:

>Hi Friends
>
>How to convert rtf file output(already exist) into any image file
>using SAS
>
>Let know the solution
From: Mark D H Miller on
Satya,

An RTF file is NOT an image file; it is a TEXT file ( RTF <=> Rich Text
Format)
It may contain imbedded image a variety of image sources, with the
image and all
of its metadata stored between two markup tags starting " {\pict" and
ending at the matching "}"
Since it is a tagged format, you could write SAS code to scan the source
file and
parse out the image components, but converting to an image format other
than the one
imbedded into the rtf file is a problem probably best solved with some
tool other than SAS.

The image format is specified in the RTF coding. The picture itself may
appear in
the RTF file in a hexadecimal or a binary format. Current supported
values of "pictype" are
\emfblip | \pngblip | \jpegblip | \macpict | \pmmetafile | \wmetafile
| \dibitmap <bitmapinfo> | \wbitmap <bitmapinfo>
which correspond to emf ; png ; jpeg ; [mac] pict ; [os2 vs Win]
metafile ; [dib vs WinDib bitmap] bmp

Possible followup references

Python discussion group message which gives somewhat more info than
above
http://mail.python.org/pipermail/tutor/2009-February/067266.html

MS online description of the RTF specification (buried in the Office
documentation)

http://msdn.microsoft.com/en-us/library/aa140283%28office.10%29.aspx

http://msdn.microsoft.com/en-us/library/aa140283(office.10).aspx
**<<== same as above but parentheses are not coded in url ;

RTF Picture Extractor (VB program to extract images to WMF files
-- ++SOURCE )
http://www.tripletee.com/freeutils.htm

Delphi code to save/load images in RTF as PNG
(in 2003 native Delphi did not support all guest RTF formats
except PNG ++SOURCE)

http://www.trichview.com/support/trichview.support.examples/example_howtosave_loadimagesinrtfaspng.htm
Delphi/C++ libs now (2009) support all pre-defined formats
allowed in rtf (product = tRichView)


.... Mark Miller



On 2/4/2010 8:44 PM, Arthur Tabachneck wrote:
> SAS may well be able to do that, but I'm not aware of it having that
> functionality. Conversely, this OLD response, from 1991, suggests an
> alternative:
>
> http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0109c&L=sas-l&F=&S=&P=1303
>
> HTH,
> Art
> --------
> On Thu, 4 Feb 2010 09:30:20 -0800, Satya<kondal4uall(a)GMAIL.COM> wrote:
>
>
>> Hi Friends
>>
>> How to convert rtf file output(already exist) into any image file
>> using SAS
>>
>> Let know the solution
>>
>
From: Ya Huang on
Based on OP's previous post, I believe the intention is to convert
a WORD table (which is much better looking than old text based table),
into a bitmap format image file, so that it preserve the nice looking of
the table, yet nobody can edit it. I know some pharm company do this
kind of thing, so that every formal report can be traced back to the
programming.

I did some search, it seems that VBscripting might be possible to
open up the rtf file, then 'Print Screen' and paste to some kind of
graph program, such as MS Paint, the later then save it into
an image file.

I also believe OP won't accept pdf file, even though SAS can produce
encrypted pdf file that nobody can copy/paste. The reason is that the
'image table' will be inserted into a word file, which might be a
clinical study report, you can't really insert a pdf file into word.

ODS/EPS might be close to what is desired.

Not long ago, OP showed the code to use proc gprint to
convert a text based table into a image, a very old method, but
table looks not as nice as word table.

On Thu, 4 Feb 2010 21:27:56 -0800, Savian <savian.net(a)GMAIL.COM> wrote:

>On Feb 4, 10:30 am, Satya <kondal4u...(a)gmail.com> wrote:
>> Hi Friends
>>
>> How to convert rtf file output(already exist) into any image file
>> using SAS
>>
>> Let know the solution
>
>You have been given good advice on what RTF is. In .NET you can
>convert RTF to PDF if that is your desire but you do need to get out
>of using SAS for this conversion. What do you want to do with it? A
>little bit of information would help.
>
>Alan
>http://www.savian.net
From: Savian on
On Feb 5, 9:47 am, ya.hu...(a)AMYLIN.COM (Ya Huang) wrote:
> Based on OP's previous post, I believe the intention is to convert
> a WORD table (which is much better looking than old text based table),
> into a bitmap format image file, so that it preserve the nice looking of
> the table, yet nobody can edit it. I know some pharm company do this
> kind of thing, so that every formal report can be traced back to the
> programming.
>
> I did some search, it seems that VBscripting might be possible to
> open up the rtf file, then 'Print Screen' and paste to some kind of
> graph program, such as MS Paint, the later then save it into
> an image file.
>
> I also believe OP won't accept pdf file, even though SAS can produce
> encrypted pdf file that nobody can copy/paste. The reason is that the
> 'image table' will be inserted into a word file, which might be a
> clinical study report, you can't really insert a pdf file into word.
>
> ODS/EPS might be close to what is desired.
>
> Not long ago, OP showed the code to use proc gprint to
> convert a text based table into a image, a very old method, but
> table looks not as nice as word table.
>
>
>
> On Thu, 4 Feb 2010 21:27:56 -0800, Savian <savian....(a)GMAIL.COM> wrote:
> >On Feb 4, 10:30 am, Satya <kondal4u...(a)gmail.com> wrote:
> >> Hi Friends
>
> >> How to convert rtf file output(already exist)  into any image file
> >> using SAS
>
> >> Let know the solution
>
> >You have been given good advice on what RTF is. In .NET you can
> >convert RTF to PDF if that is your desire but you do need to get out
> >of using SAS for this conversion. What do you want to do with it? A
> >little bit of information would help.
>
> >Alan
> >http://www.savian.net- Hide quoted text -
>
> - Show quoted text -

I would not use VBScript but use something more modern like C#/Java
etc. I have C# code that handles RTF files and it is a minor thing to
add in image support and that support would be for all major image
files. I am happy to share the C# code as needed.

Alan
http://www.savian.net