How to open local PDF files from ng-click for an android app?

Open this pdf in In App browser:

window.open('http://whitelisted-url.com/pdftoopen.pdf', '_blank');

in your case it should look something like this:

window.open(encodeURI('full/path/to/file.pdf'), '_system');

Plugin: https://github.com/apache/cordova-plugin-inappbrowser

Or you can use this plugin: https://github.com/don/FileOpener

Update: Don’t use FileOpener plugin, it’s deprecated. Use ngCordova FileOpener2. Just one warning, it can’t open assets content, file must be placed in a real system directory. I wrote a tutorial on this topic, read it here.

4 Likes