我使用UIDocumentInteractionController presentOptionsMenuFromBarButtonItem在Adobe Reader应用程序中打开PDF,用邮件发送并打印它。邮件和打印工作很好,但我无法打开任何其他应用程序。我尝试了presentOpenInMenuFromBarButtonItem和UIActivityViewController,但他们都不做我所需要的。
我试图用documentInteractionController: willBeginSendingToApplication: delegate打开Adobe Reader,但我找不到如何将pdf传递给应用程序。这是可能的吗?
如果没有,有没有另一种方法可以在adobereader应用程序中打开PDF,用邮件发送并打印它?
谢谢
通常我是这样做的:
NSURL *documentsDirectoryPath = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]];
NSURL *URL =[documentsDirectoryPath URLByAppendingPathComponent:@"your pdf"];
UIButton *button = (UIButton *)nil;
self.documentInteractionController.delegate=self;
if (URL) {
// Initialize Document Interaction Controller
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];
// Configure Document Interaction Controller
[self.documentInteractionController setDelegate:self];
//preview
[self.documentInteractionController presentPreviewAnimated:YES];
// Present Open In Menu
[self.documentInteractionController presentOpenInMenuFromRect:[button frame] inView:self.view animated:YES];
}