I have used this code :
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];
Now problem
is it takes around 30 to 50 seconds
to give these error : Error: NSError *PSPDFError(NSInteger, NSString *_strong, NSError *_autoreleasing *)/35 Error 210: documentRef is nil; cannot get pageRef
for page 1. hanging my UI completetly
and then it opens
with pdfController
with nothing