Question

My Cocoa app needs to produce documents using RTF. After much searching, I haven't yet found a Cocoa-native way to provide footers in an RTF document. For this reason it appears I have to generate RTF code rather than just saving an NSAttributedString in RTF format.

Let's say I'm producing RTF code such as:

....\pgnstart1 {\fs24\scaps\b\qc Table 1\par\ql\fs18 \par....

Should I initially store it to an NSData object, or to an NSAttributedString object, prior to saving it to disk?

Thanks in advance to all for any info.

Was it helpful?

Solution

I don’t think Cocoa’s subset of RTF reading/writing supports footers. You’ll have to create them yourself, but getting them into your RTF stream will be a chore. If you have an RTF parser you’d have to post-process the raw RTF your get from NSAttributedString to insert your custom RTF.

Not fun. The RTF parser was never really designed to be extensible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top