【问题标题】:Converting PPT or PPTX to PDF in iOS objective-c (xcode)在 iOS Objective-c (xcode) 中将 PPT 或 PPTX 转换为 PDF
【发布时间】:2013-03-07 14:12:37
【问题描述】:

我只想在 iOS Objective-C 应用程序中将 PPT 或 PPTX 文件转换为 PDF 文件。 (iPhone 和 iPad 应用程序)

但我找不到任何直接的解决方案。

有什么方法可以将 powerpoint 文件转换为 PDF 文件吗?

不需要其他选项,只是想转换它。 (不是通过生成图片,因为分辨率问题)

谢谢!

【问题讨论】:

  • 找到解决方案了吗?

标签: ios objective-c xcode pdf powerpoint


【解决方案1】:

有一种方法可以通过几个步骤来完成。

首先,您应该将 pptx 文件加载到 UIWebView 中。

// fileURL – URL of your pptx file
NSURLRequest* request = [NSURLRequest requestWithURL:fileURL];
webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
webView.delegate = self;
[webView loadRequest:request];

当您的 webView 完成加载您的 webView 的获取内容时:

NSString *htmlContent = [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];

然后您可以将您的 html 内容呈现为 PDF,而不会出现质量松动。有一个tutorial 描述了如何做到这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-22
    • 2014-09-25
    • 2012-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-28
    相关资源
    最近更新 更多