I'm a bit of a n00b when it comes to apps and all. To explain what I would like to do is add a PDF file within the app file structure, so that it will be contained within the app. Is there a way to then refer to this PDF location and open it.
I can successfully refer to the PDF on googledrive and get it to open and run, however this is going to be using mobile data limits to open each time, but some I would like to be within the app so that there is always access to these files without 3g or wi-fi signal. As well as other security implications so no need to share these online.
Is this possible, if so how do I refer to the folder structure within the app. Can PDFs be used. Its really a case of having images and text in specific way, so doing these documents as separate html would have a lot of workflow time needed, which I would like to prevent.
Can anyone help?
...Thanks!...
連結已複製
Thanks for your reply John. I was along this line of code too, but I guess the lack of pdf viewer was what was causing the stump.
Is there a way to get the file to open, such as within Chrome browser as a way around this?
I have seen this line from another site, but not sure how/if this could be modified to open a pdf saved within the app in the browser to be readable?:
<a href="#" onclick="intel.xdk.device.launchExternal('http://www.intel.com');">Launch in Browser</a>
You could use that line to launch the default for the file type you are opening. It will only work if you include the Intel XDK Device plugin. You can do this where you pick your plugins to be included in the app when built.
http://stackoverflow.com/questions/29815812/how-to-display-pdf-file-with-in-the-same-app-in-phonegap might offer some better solutions for working with PDF files.
That plugin author does include a sample > https://github.com/sitewaerts/cordova-plugin-document-viewer-sample-app < but the instructions assume you are building with Cordova CLI installed on your machine. The instructions are bit opaque, if you want help understanding how to use that plugin you might try to contact the author directly.
