我用过这段代码:
NSURL *documentURL= [NSURL fileURLWithPath:aStrPrintPdfPath isDirectory:NO];
PSPDFDocument *document = [PSPDFDocument documentWithURL:documentURL];
PSPDFViewController *pdfController = [[PSPDFViewController alloc] initWithDocument:document];
pdfController.pageTransition = PSPDFPageTransitionCurl;
pdfController.renderingMode = PSPDFPageRenderingModeFullPageBlocking;
[pdfController setUpdateSettingsForRotationBlock:^(PSPDFViewController *aPDFController, UIInterfaceOrientation toInterfaceOrientation) {
// conditionally set depending on rotation
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
aPDFController.pageMode = PSPDFPageModeDouble;
} else {
aPDFController.pageMode = PSPDFPageModeSingle;
}
}];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:pdfController];
[self presentViewController:navController animated:YES completion:NULL];
pdfController.title = @"";
[pdfController release];
[navController release];
现在problem
是否需要30 to 50 seconds
给出这些错误:错误:NSError *PSPDFError(NSInteger, NSString *_ strong, NSError * _autoreleasing *)/35 Error 210: documentRef is nil; cannot get pageRef
for page 1.hanging my UI completetly
然后opens
用pdfController
nothing