- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!...
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to do this
window.open('default.pdf', '_blank', 'location=yes');
However, not all devices have a built in pdf viewer in the webview. For example, Android does not, but iOS does.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sir,
How to open pdf file in mobile app using cordova-plugin-document-viewer plugin in HTML5 android mobile app???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
![](/skins/images/B7BA37F9CE4B52FF7CAE1FB0388839C8/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page