[英]Convert html file to PDF Document in iOS using Cocoa-Touch
[英]Local html or pdf file in Cocoa
我需要在Cocoa中打開本地(不在網絡上)的html文件或pdf文件,但在iOS中不需要打開。 我可以找到很多使用UIKit的示例,但是還沒有找到使用WebKit的完整代碼集。 有人可以幫我指出正確的方向或提供一些有關此操作的想法的幫助。
我感謝有關此問題的建議。 以下是我使用的代碼
- (void)windowDidLoad
{
[super windowDidLoad];
NSString* filePath = [[NSBundle mainBundle]
pathForResource:@"myDocumentText"
ofType:@"pdf"];
NSURL* fileURL = [NSURL fileURLWithPath:filePath];
NSURLRequest* request = [NSURLRequest requestWithURL:fileURL];
[[myWebView mainFrame] loadRequest:request];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.