Showing results for 
Search instead for 
Did you mean: 

Open PDF retrieved via odata service in SAPUI5

Former Member
0 Kudos

Hi all,

How can I show a PDF file retrieved via an ODATA service in to my SAPUI5 application?  I have looked for some controls or api's but I can not find one in the SAPUI5 labrary. Also can not find any good information on the internet.

Can someone tell me a solution?

Kind regards,


View Entire Topic
Former Member
0 Kudos

Hi Martin,

I think it is a flat pdf.

I saved my PDF document in a xstring. When I call the Odata service then I use get_stream method to produce the pdf. The same way to  retreive a Photo.

Kind regards,


Former Member
0 Kudos

For our solution we had to display a PDF from the ADS, and therefore got this directly from a URL.

Therefore we used a HTML Object from the Core library, sorry did not ask with part of SAPUI5 you were using.

We then created a OBJECT or IFRAME tag inside this to display the PDF, and had that point at URL end point that returned just the PDF Object itself.

A quick example of this would be something like this, and then just add the oHTML Content to a Control like an Overlay or something like this.

//Create Place holder for the iFrame using a HTML Object
var oHTML = new sap.ui.core.HTML();

//Set the iFrame up to call the Form Controller passing in the Form Data so the
var oContent = '<iframe id="iframeContentPanel" ' + 'src="' + formData + '"width="100%" height=600px'"></iframe>';


It's not the complete answer, but hopefully will help.


Former Member
0 Kudos

I had not thought about making use of an iFrame.

This is a good suggestion.

Kind regards

Miki von Ketelhodt