The SAS Output Delivery System and reporting techniques


Posts: 0


Hi all,

Is there any easy way using SAS to convert RTF file in a PDF file. Sorry if it is a silly question, but I have never used it before!

Many thanks,
Posts: 0

Re: RTF --> PDF


steam hammers to crack walnuts comes to mind

RTF is a particular file format with data embedded in formatting codes certain other applications will understand. PDF is another file format using other formatting codes, and there is no easy translation of which I am aware.

Conceptually you could hand craft something to surgically excise and interpret the RTF codes and reinsert PDF codes back into the data stream, but this is neither easy nor necessarily an easy task.

There are multiple helper applications about that will take a Word document and produce a PDF file, including the early versions of MS Office 2007. Since Word recognises and handles RTF files as if they were native word files, this is the path I would take.

If you use a SAS session to create an RTF file, then it seems to me it might be easier to create a PDF file at the same time by also opening a PDF destination in ODS.

Kind regards

Posts: 0

Re: RTF --> PDF

I have already try to create a PDF file at the same time I create the RTF file. But the problem is I use RTF control words, and so I can't directly use the PDF destination.
If there is no way using directly the SAS system, maybe I would use Acrobat Distiller (even if I would prefer do it using SAS)?
Posts: 8,743

Re: RTF --> PDF

David is right. If you are using RTF control strings in SAS to create your RTF file, then your best bet might be to use Acrobat Distiller or some Word plug-in to turn the RTF file into a PDF file.

Depending on what your RTF control strings are doing, you may be able to send them to the RTF destination ONLY by using RAW text strings with ODS ESCAPECHAR. But, if you want the PDF file to look like the RTF file -- then you have to go down the 3rd party software road.

In 9.2, you will be able to use the text-decoration style attributes to perform some of the underlining, etc in PDF and RTF without using control strings. But until're left to converting your RTF file to PDF using other (non-SAS) methods.

Super Contributor
Posts: 394

Re: RTF --> PDF's Writer can read RTF files and export directly to PDF. It's not an automatic solution, but it's free.

Ask a Question
Discussion stats
  • 4 replies
  • 3 in conversation