Send PDF to iBooks

IBooks now supports PDF. My application has access to many PDF files. Can I send PDF files to iBooks (or other PDF readers such as GoodReader and iAnnotate PDF) from my application?

+6
iphone pdf
source share
3 answers
//get path to file you want to open NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"readme" ofType:@"pdf"]; //create NSURL to that path NSURL *url = [NSURL fileURLWithPath:fileToOpen]; //use the UIDocInteractionController API to get list of devices that support the file type docController = [UIDocumentInteractionController interactionControllerWithURL:url]; [docController retain]; //present a drop down list of the apps that support the file type, click an item in the list will open that app while passing in the file. BOOL isValid = [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; 
+11
source share

To answer my own question - yes, you can send PDFs to applications that support custom URL schemes using this:

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; 

URL scheme for GoodReader:

 url=@ "ghttp://www.mysite.com/myfile.pdf"; 

iAnnotate PDF:

 url=@ "pdfs://www.mysite.com/myfile.pdf"; 

Does anyone know a custom url scheme for iBooks?

+2
source share

Use this link to find URL schemes http://schemes.zwapp.com/

and use [[UIApplication sharedApplication] openURL:url];

to run in this application.

thanks

0
source share

All Articles