Getting an index for NSMutableAttributed string using tags in RTF
Getting an index for NSMutableAttributed string using tags in RTF
- Subject: Getting an index for NSMutableAttributed string using tags in RTF
- From: Pax <email@hidden>
- Date: Sun, 20 Apr 2014 10:43:37 +0100
I have an NSTextView which is being populated using RTF:
if ([self getContent:@"RTF"]&&useformatting)
{
[attributedContent appendAttributedString:[[NSAttributedString alloc] initWithRTF:[self getContent:@"RTF"] documentAttributes:NULL]];
}
This works beautifully except that the RTF string references images:
{\*\htmltag84 <img border=0 width=224 height=51 id="_x0000_i1033" src="cid:email@hiddenB20" alt="LH_logo600r1idx">}\htmlrtf {\chbrdr\brdrsh LH_logo600r1idx}\htmlrtf0
I would like to make sure that the images are placed into the RTF correctly. I thought I might be able to do it by saving the image to a cache folder and specifying a root (as WebKit's loadHTMLString does), but this isn't available in NSTextView or NSMutable String.
Second, I wondered if there's a way of getting the index of the last displayed character before the image from the RTF itself.
Does anyone have any ideas how this might be achieved? As usual, all assistance gratefully received!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden