Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send PDF to iBooks

Tags:

pdf

iphone

Now iBooks supports PDF. My app has access to many PDF files. Is it possible to send PDFs to iBooks (or other PDF readers like GoodReader and iAnnotate PDF) from my app?

like image 970
user373789 Avatar asked Jun 23 '10 01:06

user373789


People also ask

How do I transfer a PDF from my iPhone to iBooks?

Open the PDF in iBooks then tap the arrow icon in the upper left corner and select Email. Copy and paste the entire lengthy email into this new email in iBooks and send it that way, its clunky, but it is really the only way to accomplish what you want to accomplish using an iPad and the mail app.

How do I open a PDF in iBooks?

You can open a PDF with iBooks by tapping "Open in iBooks" on the top right-hand corner of the screen. iBooks will immediately open the file and can save a copy of the PDF right away and display it on the virtual shelf.

Where are my PDF files in iBooks?

From the iPad's home screen, tap iBooks to open it. Tap the Collections button in the top left corner, as shown below. Tap PDF. The saved PDF files will appear, as shown below.

How do I save a PDF to Books app?

Instead, tap the screen briefly after opening the PDF, and you should see an OPEN IN link show up to the lower-right corner of the browser. Tap it, and a separate Share Sheet will show up. Tap Copy to Books on the upper row to save the PDF to the Books app.


2 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];
like image 186
AndroidUser Avatar answered Oct 23 '22 11:10

AndroidUser


To answer my own question - yes, you can send a PDF to apps supporting custom URL scheme using this:

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

URL scheme for GoodReader is:

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

iAnnotate PDF is:

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

Does anyone know the custom URL scheme for iBooks?

like image 23
user373789 Avatar answered Oct 23 '22 12:10

user373789