Is it possible to open a pdf file from an app itself into iBooks.
OR
any 3rd party solutions, that can use any pdf file and create a flip book thing in an app itself.
You can indeed open a PDF file from an app into iBooks (or any other installed app that can read PDF files).
To do this, you can use the UIDocumentInteractionController
NSString *pdfPath = @"path to your pdf file";
NSURL *url = [NSURL fileURLWithPath:pdfPath];
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:url];
docController.delegate = self;
[docController retain];
// docController is released when dismissed (autorelease in the delegate method)
BOOL isValid = [docController presentOpenInMenuFromRect:readPdfButton.frame inView:self.view animated:YES];
if (!isValid) {
NSString * messageString = [NSString stringWithFormat:@"No PDF reader was found on your device. In order to consult the %@, please download a PDF reader (eg. iBooks).", yourPDFFileTitle];
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:messageString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];
}
...
// UIDocumentInteractionController delegate method
- (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller {
[controller autorelease];
}
The UIDocumentInteractionController
will open a popover (on iPad) or an action sheet (on iPhone) with a choice of all the PDF capable apps that are installed on the device so the user can choose his favorite one he wants to read the PDF with.
There are also a few decent PDF reader libraries you can use to open the PDF directly in your app, rather than having to switch application, one of which is VFR PDF Reader/Viewer for iOS
来源:https://stackoverflow.com/questions/8428352/an-app-to-open-ibook-and-then-this-particular-pdf-pub-file-straightaway-in-one-g