简体   繁体   English

在iOS中显示Powerpoint演示文稿

[英]Show Powerpoint Presentation in iOS

In my app I have dropbox implementation and user can download the documents from dropbox and see that one by one like a slideshow. 在我的应用程序中,我有dropbox实现,用户可以从dropbox下载文档,并像幻灯片一样逐个查看。 My Problem is that if user downloads .ppt file then how to show powerpoint presentation with all its animations on iPhone without using other app like slide shark. 我的问题是,如果用户下载.ppt文件,那么如何在iPhone上显示带有所有动画的powerpoint演示文稿,而不使用其他应用程序,如幻灯片鲨鱼。

Only way is Using the Quick Look Framework . 唯一的方法是使用快速查看框架

Use the Quick Look framework to provide previews of items that are in formats you don't handle—such as iWork or Microsoft Office . 使用“ 快速查看”框架可以提供未处理格式的项目(如iWork或Microsoft Office)的预览。 This framework affords you more control over the preview process than you get from the UIDocumentInteractionController class—including choosing whether the preview is displayed in the context of a navigation controller or modally (full screen). 此框架使您可以更好地控制预览过程,而不是从UIDocumentInteractionController类获得 - 包括选择预览是在导航控制器的上下文中显示还是以模态(全屏)显示。 The primary class in this framework is QLPreviewController, which provides a specialized view for previewing an item. 此框架中的主要类是QLPreviewController,它提供用于预览项目的专用视图。 It relies on a delegate for mediating preview actions, and a data source for providing the preview items. 它依赖于delegate for调解预览操作,以及用于提供预览项的数据源。

In iOS 4.2 and later, the specialized view presented by a Quick Look preview controller includes an action button with a Print item. iOS 4.2及更高版本中,Quick Look预览控制器提供的专用视图包括带有Print项目的操作按钮。 If the controller can provide a preview of a file, it can also print it. 如果控制器可以提供文件的预览,它也可以打印它。 There is no printing code for you to write. 没有打印代码供您编写。

To display a Quick Look preview controller you can use any of these options: 要显示Quick Look预览控制器,您可以使用以下任何选项:

  1. Push it into view using a UINavigationController object. 使用UINavigationController对象将其推入视图。
  2. Present it modally, full screen, using the presentModalViewController:animated: method of its parent class, UIViewController . 使用presentModalViewController:animated:类的方法, UIViewController ,以模态,全屏显示它。
  3. Present a document interaction controller (as described in “Previewing and Opening Files.” The user can then invoke a Quick Look preview controller by choosing Quick Look from the document interaction controller's options menu. 呈现文档交互控制器(如“预览和打开文件”中所述)然后,用户可以通过从文档交互控制器的选项菜单中选择“快速查看”来调用“快速查看”预览控制器。

A Quick Look preview controller can display previews for the following items: 快速查看预览控制器可以显示以下项目的预览:

Microsoft Office documents (Office '97 and newer) Microsoft Office文档(Office '97及更新版本)

iWork documents iWork文档

Rich Text Format (RTF) documents 富文本格式(RTF)文档

PDF files PDF文件

Images 图片

Text files whose uniform type identifier (UTI) conforms to the public.text type (see Uniform Type Identifiers Reference) 统一类型标识符(UTI)符合public.text类型的文本文件(请参阅统一类型标识符参考)

Comma-separated value (csv) files 逗号分隔值(csv)文件

看看UIDocumentationInteractionController ,这可能比使用快速查看更容易,根据您的需要,您可以更好地控制动画然后快速查看,但需要大量挖掘。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM