10-22-2012 11:14 AM
I'm currently working on a small webworks app for a PlayBook tablet.
Essentially it's an html page with links to pdfs that are packaged with the app.
I know you can't embed a pdf.
I know you can open a local pdf saved in the shared documents folder using file:///accounts/1000/shared/documents/test.
What I don't know is how to open a pdf stored in the installed apps directory.
For instance (#s being the jumble of alphanumerics of the app):
This works for a test.jpg, no errors.
But then I get the error "The file path is not valid" when I try it with a pdf.
I'm using the following in the config.xml
<rim: permit>access_shared</rim: permit>
<access uri="file:///accounts" subdomains="true"/>
Is this because the Adobe Reader app doesn't have access to the specific directory?
If so is there a way to allow the reader to have said access? ("Config/Security/Application Permissions" does not list Adobe Reader)
Any help would be much appreciated!
10-24-2012 04:12 PM
This is currently not possible on the PlayBook. On BB10, you can use the invoke api to pass the URL to the PDF Reader as described here: https://developer.blackberry.com/html5/apis/blackb
One workaround is to have the user download and save the PDF and open it using File Explorer/PDF Reader.
10-26-2012 02:27 PM
Thanks for the reply,
I'd rather have the PDFs existing since it is a stand alone webapp (no connection).
That being said, for now the shared data works.
However, the default playbook PDF reader has very limited functionality, as lots of you know.
I downloaded qPDF and was quite surprised by it's improvement over Adobe's Reader.
It can't open external links to other PDFs but internal links work correctly.
I'll have to test the .invoke function later when we look at BB10 here.
10-26-2012 02:38 PM
The PDF files are quite large and complicated. I doubt I would be able to get pdf.js working properly with them.
We do use another WebApp which requires to open small/simple PDFs, and I was looking into pdf.js. It may do the trick if I can get it working properly...