- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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!...
- Balises:
- HTML5
- Intel® XDK
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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>
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hello Sir,
How to open pdf file in mobile app using cordova-plugin-document-viewer plugin in HTML5 android mobile app???
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable