【问题标题】:Cocoa: Can I render ms office files on the WebView on the osXCocoa:我可以在 osX 的 WebView 上渲染 ms office 文件吗
【发布时间】:2013-02-17 08:25:12
【问题描述】:

在 iPhone 编程中,我可以使用以下代码在 iOS 上的 UIWebView 上打开 ms office 文件(.doc、.docs、.ppt、.xls、...)

NSURL* url = [NSURL fileURLWithPath:filePath];    
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request]; // webView -> UIWebView outlet

但是,我在 OSX 上使用 WebView 进行了尝试

NSURL* url = [NSURL fileURLWithPath:filePath];    
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[[webView mainframe] loadRequest:request]; // webView -> WebView outlet

但是在OSX应用的WebView上,程序不会

打开任何 ms office 文件。

谁能帮帮我?

【问题讨论】:

    标签: xcode macos cocoa webview ms-office


    【解决方案1】:

    回答我的问题。

    我解决这个问题的方式与我的问题不同。

    我使用了 QuickLook 框架。

    所以现在我可以将 ms 文档显示到 QuickLook 面板。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 1970-01-01
      • 2013-06-28
      • 2013-10-12
      • 1970-01-01
      • 2017-10-15
      相关资源
      最近更新 更多