Cordova Android display Base64 encoded PDF in browser - android

What would be the simplest way to render a PDF document whose Base64 encoding is returned from a web service on an Android app built using cordova?
Can this be done without additional plugins?
Any sample code would be useful.

Related

How to convert blob to base64 on React Native

I'm developing an application that runs both web and mobile app (React Native).
In the mobile app, I have to fetch a file from S3 Bucket and convert it to base64 in order to show and write it to mobile storage.
When fetching a file that has a small size, I just fetch a file from S3 without responseType.
But when I fetch a large file, I don't get any data from API and the mobile app is stunned (it keeps loading and I cannot get any response from API). So I have to pass responseType: 'blob' to get data from API.
My question is: How to convert or read Blob to base64 while React Native cannot use FileReader like a web application?
Thanks in advance!
Oh I try using FileReader to read Blob and it work! I thought FileReader is not working in React Native

React native (android) can only download http/https uris:data:application/base64,3e6XfoJgp1PyzXV1TUflJBKlm

im using rn fetch for download file from base64 everything work great in ios but when i run it in android it show this error :
Well I am trying to download file via download manager my url adress is a base64 pdf
appreciate any help

Download base64 file cordova android (via javascript)

I have a Website(ReactJs) with a pdf download functionality(via base64) and it works fine. For Android, I have a cordova app where the app is pointed to website and no actual app code resides inside cordova and this is where the problem starts.
The PDF download is not working in app and I have been restricted from using native java code or Cordova(js + file-plugin).
Is there any way to achieve this with given constraints?

Ionic2 - Base64 PDF

I am currently developing a mobile project using Cordova and Ionic2 using an external database resource that connects to the mobile via REST webServices.
The database has documents pdf saved that you have to send to the mobile and view the same. I am using the pdf in enconding Base64 through the webservices by Json.
I can get the string in base64, but I do not quite understand how to decode it and save it on mobile, which is Android to be able to see it.
Use the native File component from Ionic 2.
ionic cordova plugin add cordova-plugin-file
npm install --save #ionic-native/file
To save the base64 string on the device you call the createFile(path, fileName, replace) method.
More info: Ionic 2 File
I had a similar battle with PDF's, but dealing with them in binary/Blob form. Similar problem/solution overall. It seems that PDF opening isn't as simple as it should be across Web/Android/iOS.
Open createObjectURL Blob on Cordova InAppBrowser

Embed PPT to HTML (for a webview in Android)

Does anyone know a way to embed a PPT file (powerpoint) into a HTML?
I found solutions like embed through an iframe by Office Web App and/or Google Docs. I tried them and works fine into the HTML, but in my case I need to have the PPT file into a personal server.
Other options I found are like Embedit.in, a flash embed that shows th PPT (no convert the PPT to SWF (flash format)).
But, I still looking for a way for show a PPT file saved in a personal server into a HTML, any idea? any webservice for this problem?
Before PowePoint 2010 you could save the ppt to html using PowerPoint API.
Did you checked also for api vendors? It's a common issue probably there api to do that.
Suggestion...
Convert the ppt to pdf and use the code generator # http://pdfobject.com/generator.php .
Use standard (not java) .
There in one small mistake in the code they generate Remove the hashtag # at the end of the url.

Categories

Resources