How a framed table should be end in RTF file?

Reply
Occasional Contributor
Posts: 5

How a framed table should be end in RTF file?

We have a RTF file which contains absolute positioned framed tables and framed text paragraphs.

In this RTF file a framed table is ending with control word "\row}". Because of this reason, our application is unable to read this RTF file.

Hence, while reading this RTF file our application is hanging. We have checked the RTF Specification 1.9 but, we didn't get any clue.
Please find the attached issue RTF file

Kindly go through the attached RTF file and let us know how a absolute framed table should be ended with.

Note: Our application is able to read the above RTF file successfully, if it is saved in MS office.

Thanks in advance.

Attachment
Esteemed Advisor
Esteemed Advisor
Posts: 7,232

Re: How a framed table should be end in RTF file?

Hi,

Well, several things here.  Let me start with the SAS output.  SAS creates tabular output, this can be thought of as blocks in a file, so file information (styles etc), row header information, and rows.  Hence the table is ended with a \row command, as per the RTF 1.9 spec.  I have no idea what this "absolute framed table" concept is you mention, nor see it in any search on the net.  Perhaps if you could detail your issue with the output a bit more?

Secondly, your problem appears to be one of reading a file into this "application" you mention.  Unfortunately you don't mention what this application is, either commercial or private, what it is doing/expecting etc.  If it is something you have built then you need to look at what that is expecting/why it is going wrong at your application level.   The reason is that pure RTF readers should have no problem with the SAS ouput, for instance I opened the RTF you supplied in Word (which uses an RTF parser) and it rendered that fine.  Hence this would indicate that the generated RTF is fine, and that it is the "application" which needs to be addressed.

Occasional Contributor
Posts: 5

Re: How a framed table should be end in RTF file?

Hi,

Thank you for your reply.

Now, we are trying to explain our problem in more details as shown below:

We are using a third party component in our application. This component is used to read RTF files and display the thumbnail. If the reading is successful, our application displays thumbnail of the RTF file. But, this component is unable to read the attached RTF file (example: NG.rtf) and it is going to "not responding state"(i.e hanging).

We have observed that this component is unable to read the RTF file (example: NG.rtf), in which the contents(example: tables, text paragraphs) are placed in frames. There is no problem, if the content is not placed in the frames.

We don't have source code of this third party component.

Hence, we cannot see the source code of this component.

Hence, we cannot address this problem from our application side.

We have added the below sequence of control words after the control word "\row}" in the attached RTF file and we have found that our applications is successfully reading this modified RTF file.

-------------------------------------------------------------------------------------------------------------------------

\pard\plain\wrapdefault\aspalpha\aspnum\faauto\adjustright\cgrid\fs2\afs2

\par

-------------------------------------------------------------------------------------------------------------------------

Kindly, let us know how the RTF reader interprets the above sequence of control words.

Note: We have found that the above sequence of control words after the control word "\row}" in some RTF file which we found through internet.

Thanks in advance for your great help.

Esteemed Advisor
Esteemed Advisor
Posts: 7,232

Re: How a framed table should be end in RTF file?

Sorry, not really able to help much more.  The file works fine through Word with or without those rows of code, so I would assume that it is ignoring them.  As for the third party component, I don't know what it is, what level of interpretation or flexibility it has.  Could be any number of things, not optionally closing a frame etc. and without some kind of log or knowledge of the expectations of this component its quite hard to say.  Perhaps run it past the tech support, or the tech support for the third party component?

Occasional Contributor
Posts: 5

Re: How a framed table should be end in RTF file?

Hi,

Thank you for your reply.

Kindly, let us know exact meaning for the below sequence of control words

\pard\plain\wrapdefault\aspalpha\aspnum\faauto\adjustright\cgrid\fs2\afs2

\par

Esteemed Advisor
Esteemed Advisor
Posts: 7,232

Re: How a framed table should be end in RTF file?

They are all in the RTF9 spec:

\pard\plain\wrapdefault\aspalpha\aspnum\faauto  && \fs2\afs2= reset paragraph/char defaults

\adjustright\cgrid = character grid and alignment

\par = new paragraph

As mentioned, I don't see why these would be needed, in the Word RTF parser it is ignored.

Occasional Contributor
Posts: 5

Re: How a framed table should be end in RTF file?

HI,

Thank you for your reply,

In RTF9 Spec, we have found that the meaning of "\par" is "End of paragraph" under the section "Special Characters" (Pg No: 143).


Kindly let me know what is the actual meaning of "\par".


Thanks in advance.

Esteemed Advisor
Esteemed Advisor
Posts: 7,232

Re: How a framed table should be end in RTF file?

End of Paragraph, new paragraph, its all similar.  It basically means the previous paragraph is finished, a new one begins.  Its a delimiter.

SAS Super FREQ
Posts: 8,720

Re: How a framed table should be end in RTF file?

Hi:

  Questions about the RTF spec are really not relevant to this Forum unless SAS is generating the RTF file. And, since SAS doesn't do absolute positioning, it seems unlikely that SAS is generating the RTF code. However, if you do have RTF output that is generated by SAS and if you are changing the RTF output with a program to add additional RTF control strings, you must be very careful. Any "extra" or mismatched characters you introduce into the RTF file run the risk of corrupting the RTF file and making it unreadable. Since RW9 was so generous with his time and tested your RTF file in Word, you now know that the RTF file has not been corrupted.

  Usually, when SAS makes an RTF file, this information is put into the Author/operator field (unless you change it)

{\author SAS Version 9.4}{\operator SAS Version 9.4}

  I did not see this author/operator information in your NG.rtf file, so this implies to me that your RTF file was not created by SAS and the ODS RTF destination. However, if you used some other SAS process to create the RTF file, then questions about how to correctly generate the RTF file with your program should be directed to Tech Support. You should plan to give them ALL of your code and a sample of your data for the most complete help.

  Otherwise, for information about the RTF specification, I have found this O'Reilly book RTF Pocket Guide - O'Reilly Media to be quite helpful at understanding the RTF spec, especially the control strings like \par.

RTF Pocket Guide

By Sean M. Burke

Publisher: O'Reilly Media

Final Release Date: July 2003

ISBN-13: 978-0596004750

cynthia

Ask a Question
Discussion stats
  • 8 replies
  • 407 views
  • 0 likes
  • 3 in conversation