使用Adobe Reader使用WebViewController从自己的应用程序打开PDF [英] Use Adobe Reader to open a PDF from own app using WebViewController

查看:294
本文介绍了使用Adobe Reader使用WebViewController从自己的应用程序打开PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iPad应用程序中,我有一个按钮,可以使用WebViewController打开文档来查看文件。

In my iPad app, I have a button that opens a document using a WebViewController to view the file.

对于在iOS4中可以查看的某些PDF文档,打开它们在iOS5上现在崩溃了应用程序。如果我尝试查看附加到电子邮件的这些PDF文档,则会在Mail中发生同样的事情。但是,如果我点击并按住Mail并选择使用Adobe Reader打开,文档将成功打开。

For certain PDF documents that were viewable in iOS4, opening them on iOS5 now crashes the app. The same thing happens in Mail if I try to view these PDF documents that are attached to emails. However, if I tap and hold in Mail and select "Open with Adobe Reader," the document opens successfully.

有没有办法更改用于生成WebViewController中的PDF视图使用Adobe Reader查看器而不是原生PDF查看器?

Is there a way to change what is used to generate the view of the PDF in the WebViewController to use the Adobe Reader viewer, rather than the native PDF viewer?

我想在同一个WebViewController中直接执行此操作,而不是使用显示在Adobe Reader中打开提示符的UIDocumentInteractionController弹出窗口。

I would like to do this directly within the same WebViewController, rather than using a UIDocumentInteractionController popover that shows the "Open in Adobe Reader" prompt.

推荐答案

据我所知,唯一可行的方法是Adobe Reader有自定义URL方案。您可以使用PDF扩展拦截URL并重新设置URL以使用URL方案。但是,据我所知,Adobe Reader不提供此URL方案。

To my knowledge the only way to do this would be if the Adobe Reader had a custom URL Scheme. You could 'intercept' the URL with a PDF extension and re-craft the URL to use the URL Scheme. However, to my knowledge Adobe Reader doesn't provide this URL scheme.

话虽如此,您可以让用户选择使用他们选择的查看器打开文件(如果他们在本地保存)。如果Adobe Reader已注册打开PDF文件(我确定是这样),那么您可以创建一个打开方式按钮来确定应该如何打开它。它将显示所有可以打开PDF文件的程序。有关此问题的更多信息,请查看Apple文档:

That being said, you can give the user the option to open files with a viewer of their choice (if they save it locally). If Adobe Reader is registered to open PDF files (and I'm sure it is) then you can create an 'Open With' button to determine how it should be opened. It will show all programs that can open a PDF file. For more information on this, check the Apple documentation:

http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS /Articles/RegisteringFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1

这篇关于使用Adobe Reader使用WebViewController从自己的应用程序打开PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆