Mobile app - Unable to preview a pdf document using base64
Question
Application Type
Mobile
Service Studio Version
11.14.12 (Build 59645)
Platform Version
11.12.0 (Build 30456)

Hello community, perhaps someone can help me with this one.

I have requirement to preview PDF files inside a mobile application. However due to customer's security concerns the file should not be downloaded into the device's filesystem. This means I cannot use any component that uses a file saved on a local path (like the file preview component for instance).

Therefore I have been trying to use <embed> and <iframe> tags using as source "data:application/pdf;base64,<base64convertedbinary" (see below screenshot). 

However, none of them appear when testing an android device (using Android 11). I have no errors just a blank screen.

When testing on a google chrome browser, the "Embed" element works but "iframe" does not (Iframe only did work on the browser when setting the src to an external URL). 

I appreciate your help. Thank you


These are the tags I am using

This is the result using chrome browser (embed works but not iframe):

On the android device nothing is shown.

Hi Pedro ,

I think there is typo instead of base64 you have written base6. Check below screen shot


Best Regards

Devendra

In my case below code is working fine. Hope it helps:

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.