Software Archive
Read-only legacy content
17061 Discussions

Open PDF file (stored locally) in android

Nagaraja_S_
Beginner
896 Views

Hi,

I have a requirement to open a PDF file from my android app (built using Intel xdk). And would like to know whether I can show the default file opener select message from the app?
I tried this code, but it didn't work. Got an error saying fileOpener is not defined.
window.plugins.fileOpener.open(<<file path>>)

I added the File plugin.
Not sure if I'm missing anything. If you have any insights on this, can you please let me know.

Thanks,
Naga

0 Kudos
1 Reply
John_H_Intel2
Employee
896 Views

Android webviews do not contain a built in pdf viewer by default. You will need to add a 3rd party plugin that can handle PDF files. I have not tried it, but this one looks promising.

https://github.com/sitewaerts/cordova-plugin-document-viewer

 

0 Kudos
Reply