2

ファイルがあり.rtfます。の画像が含まれていますWindows Metafile Format(wmf)iOSこのファイルをアプリで表示したい。NSAttributedStringと inを使用して表示しようとしましUIWebViewたが、画像が表示されません。どうすればiOSデバイスに表示できますか?

編集

の場合NSAttributedString:

var urlpath = NSBundle.mainBundle().pathForResource("txtFile", ofType: "rtf")
var url:NSURL = NSURL.fileURLWithPath(urlpath!)!
if let attributedText = NSAttributedString(fileURL: url, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType], documentAttributes: nil, error: nil) {
    textView.attributedText = attributedText
}

の場合UIWebView:

NSString *path = [[NSBundle mainBundle] pathForResource:@"txtFile" ofType:@"rtf"];
NSURL *url = [NSURL URLWithString:path];
[self.webView loadRequest:[NSURLRequest requestWithURL:url]];

EDIT2

.rtfファイルを.rtfdファイル形式に変換してみました。

RTFD ファイルは、ファイル内の画像とバンドルを作成TXT.rtfします。TXT.rtfファイルでは、画像は参照として提供され、RTFD に個別に保存されます。次のように:

{{\NeXTGraphic img1.png \width40 \height20}¬}

ファイルを RTFD に変換しましたが、ファイルに.wmf画像が含まれていると問題が発生します。.wmfファイル形式の画像が変換されません。

4

1 に答える 1