将PDF发送到iBooks [英] Send PDF to iBooks

查看:160
本文介绍了将PDF发送到iBooks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在iBooks支持PDF。我的应用可以访问许多PDF文件。是否可以从我的应用程序向iBooks(或其他PDF阅读器,如GoodReader和iAnnotate PDF)发送PDF?

Now iBooks supports PDF. My app has access to many PDF files. Is it possible to send PDFs to iBooks (or other PDF readers like GoodReader and iAnnotate PDF) from my app?

推荐答案

//get path to file you want to open 

NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"readme" ofType:@"pdf"];

//create NSURL to that path

NSURL *url = [NSURL fileURLWithPath:fileToOpen];

//use the UIDocInteractionController API to get list of devices that support the file type

docController = [UIDocumentInteractionController interactionControllerWithURL:url];

[docController retain];

//present a drop down list of the apps that support the file type, click an item in the list will open that app while passing in the file.

 BOOL isValid = [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];

这篇关于将PDF发送到iBooks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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