我使用 UIDocumentInteractionController PresentOptionsMenuFromBarButtonItem 在 Adobe Reader 应用程序中打开 PDF,通过邮件发送并打印。邮件和打印工作正常,但我无法打开任何其他应用程序。我尝试了presentOpenInMenuFromBarButtonItem 和UIActivityViewController 但它们都不能满足我的需要。
我尝试使用 documentInteractionController: willBeginSendingToApplication: delegate 打开 Adobe Reader,但我无法找到如何将 pdf 传递到应用程序。可能吗?
如果没有,是否有另一种方法可以在 Adobe Reader 应用程序中打开 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];
}
关于ios - UIDocumentInteractionController PresentOptionsMenuFromBarButtonItem 不打开应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33156525/