0

I have made a hybrid app using jquery mobile and now I want to open few docs such as pdf,pptx etc.which are already included in project on a button click. I have the liberty to open it inside as well as outside the app. Ouside the app will be feasible I guess as device can then take care of opening. I want to install app in iOS, windows and android device. Any help would be appreciated.

1 Answers1

0

@user2621561, you can achieve your requirement by using Cordova file, file transfer and file opener plugin.

If the file is available in server, first you got to download the file using file transfer plugin and store it in device using file plugin and then you can open the file using file opener plugin. Have tested this approach in iOS and android, it works. Not tested in windows though.

Gandhi
  • 11,875
  • 4
  • 39
  • 63
  • Thanks...appreciate if could share any links for this... also the files are stored in the project solution itself so do I need to store them in device explicitly? – mainprashant89 Mar 23 '16 at 09:16
  • @user2621561, i dint understand what you mean by files stored in project. Fileopener plugin demands that the file should be available in the device. Check out this link - https://github.com/pwlin/cordova-plugin-file-opener2 for more info. Can share the sample code in answer if it helps. – Gandhi Mar 23 '16 at 11:02