Jayshree
Jayshree

Reputation: 281

loading and formatting the rtf file in UIWebView

I am trying to load the contents of a rtf file in the UIWebView. I am successful in loading the contents, but it is unformatted. the fonts are too large and it doesn't have any format. it displays the color of the rtf content, but not the font or size. So what should i do now. is there any other way to load the rtf and format it? I load the rtf in following way:

NSString *path = [[NSBundle mainBundle] pathForResource:@"Home" ofType:@"rtf"];
NSURL *url=[NSURL fileURLWithPath:path];
NSURLRequest *req=[NSURLRequest requestWithURL:url];
[menuWeb loadRequest:req];

So what should i do now?

Upvotes: 3

Views: 1780

Answers (2)

P i
P i

Reputation: 30684

http://cutesoft.net/example/editRTF.aspx

This page is a WYSIWYG HTML generator. It generates extremely clean HTML (*), which I can then save and insert in my project. I can then modify this HTML file from within Xcode. All very nice!

(*) provided you use it right... flip between the normal view, HTML view and final view -- don't make it export into the second text box otherwise everything comes out in an impenetrable chunk.

Upvotes: 0

Sneakyness
Sneakyness

Reputation: 5403

Use HTML instead, it's the only way you're going to get the control you want.

Upvotes: 1

Related Questions