[Mobile] preview file from local storage

We are building a mobile app where we need to show PDF documents, stored as binary data in the local storage, in the app itself. 

We tried the File Viewer Plugin, but this can only open the documents externally on Android.

Is there a way to view PDF documents directly in the app?

Hi Christopher,

I did get it working using 

https://www.outsystems.com/forge/component-overview/6223/mobile-pdf-preview

I was able to see a PDF in the previewer in the browser of my laptop:

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Christopher,

I did get it working using 

https://www.outsystems.com/forge/component-overview/6223/mobile-pdf-preview

I was able to see a PDF in the previewer in the browser of my laptop:

Regards,

Daniel

Hi Daniel,
I'm looking for a solution to show pdf files that are stored locally on the device or in the local storage as binary data. It should also be possible to show the pdf files when the device is offline.

This plugin looks like it works with files stored on a file share.

Regards,


Hi Christopher,

I would in that case rely on the file-plugin to store your PDF locally, that way you have all the local storage capability of your device available, not the (less bigger) capacity of the browsers offline storage quota.

Than use the file-plugin to retrieve the PDF document binary data.

Then use binarydata-client-side to convert the binary to a base64 string.

The base64 string you can then show in the URL (with for example the component i shared in my orignal post, but easily done without by setting the url to:

 "data:appliation/pdf;base64," + Base64String

Regards,

Daniel