OmniGroup's RTF Reader
Add the RTFReader folder to your XCode project.
Add the following to your project's prefix.pch.
#import <OmniBase/OmniBase.h> #import <OmniFoundation/OFCharacterSet.h> #import <OmniFoundation/OFStringScanner.h> #import <OmniFoundation/OFNull.h>
Link with CoreText.framework.
Use the RTF reader.
NSString *rtfString = ... NSString *plainTextString = [[OUIRTFReader parseRTFString:rtfString] string];
Why did I do this?
- I needed a way to convert RTF encoded strings to plain text.
- I did not wish to force users of my project to include all of OmniGroup's frameworks.
- I enjoy pain?
The OUIRTFReader may be found here.
There is probably more included here than strictly needed.
I am of course open to pull requests that simplify any or all of this.