0

I'm creating a hybrid app in android which need to open the pdf files manually stored locally. How to make android open that file without net, it should be opem within the app without using any other software? thank you

C.Laetitia
  • 11
  • 6

1 Answers1

0

Android does not provide a built-in PDF reader like iOS does, so you are limited in your options:

Here are some suggestions:

  1. View the file using Google Docs by storing the file at a remote server and redirecting the user like so: window.open(encodeURI('https://docs.google.com/gview?embedded=true&url=http://www.your-server.com/files/your_file.pdf'), '_blank', 'location=yes,EnableViewPortScale=yes');

  2. Or use a Cordova plug-in. For example this one (you can search in Google for more). For this, you'll need to learn how to create Cordova plug-ins in Worklight.

You can read more options here: Phonegap InAppBrowser display pdf 2.7.0

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89