现在iBooks支持PDF。我的应用程序可以访问许多PDF文件。是否可以从我的应用程序将PDF发送到iBooks (或其他PDF阅读器,如GoodReader和iAnnotate PDF)?
发布于 2010-09-28 21:18:57
//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];发布于 2010-06-24 02:03:38
为了回答我自己的问题--是的,你可以使用以下代码向支持自定义URL方案的应用程序发送PDF:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];GoodReader的URL方案是:
url=@"ghttp://www.mysite.com/myfile.pdf";iAnnotate PDF是:
url=@"pdfs://www.mysite.com/myfile.pdf";有没有人知道iBooks的自定义网址方案?
发布于 2011-08-30 14:51:38
使用此链接查找url方案http://schemes.zwapp.com/
并使用[[UIApplication sharedApplication] openURL:url];
在该应用程序中启动。
谢谢
https://stackoverflow.com/questions/3098342
复制相似问题