Skip to Content
avatar image
Former Member

SAPUI5 PDFViewer Source property doesn't accept base64 pdf path?

Hi,

Thanks in Advance,

I am using SAPUI5 PDFViewer in my application. When I set the source property to the pdf file path, it is working fine. But when I set the base64 pdf value to the source property, the pdf is not visible.

Kindly provide any solution, or is there any way to extend the sapui5 control to adapt to the base64 pdf value as source.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 31, 2017 at 09:28 AM
    -1

    Hi Ajit,

    Use it as following it'll work.

    <iframe src="data:application/pdf;base64, yourBase64ContentGoesHere" />
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2017 at 09:34 AM

    Define your PDFViewer like this :

    <PDFViewer source="data:application/pdf;base64,{/Source}" title="{/Title}" height="{/Height}">
    				<layoutData>
    					<FlexItemData growFactor="1" />
    				</layoutData>
    			</PDFViewer>
    

    Whenever you use base64 encoded data, you have to mention the data parameter while rendering the data in the browser.

    Hope this helps,

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06 at 01:58 PM

    did you find any solution to this problem?

    I'm facing the same issue and the two answers above don't help

    thanks

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 08:40 AM

    Hi Ajit Kumar B.

    Did you find or get a solution for this?

    Add comment
    10|10000 characters needed characters exceeded