cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Print PDF

former_member225463
Participant
0 Kudos

Hello Experts,

I am trying to do the print functionality in sapui5  through OData Service.

My service is giving the result , but in my screen its showing only Loading for a long time and not displaying anything.

Please check the below code and help me out.

var oButton = new sap.ui.commons.Button({

  id : 'B-Create',

  text : 'Display PDF',

  width : '10em',

  press : function(){

      var sRead = "/zpdfset('" + oTF.getValue() + "')" + "/$value" ;

    

      oModel.read( sRead, null, null, true, function(oData, oResponse){

  var pdfURL = oResponse.requestUri;

            

             html.setContent("<iframe src=" + pdfURL + " width='700' height='700'></iframe>");

  

             oPanel.addContent(html);

             oPanel.placeAt("content");

            

    

         },function(){

             alert("Read failed");});

  }

  });

Regards,

Vikash

Accepted Solutions (0)

Answers (1)

Answers (1)

santhu_gowdaz
Active Contributor
0 Kudos

see this thread-PDF printing in SAP UI5

check out this example

JSPDF - JSFiddle

former_member225463
Participant
0 Kudos

Hi Santosh,

Thanks for the information.

I have added the JSPDF Plugins into my application but i am getting errors and print is not getting displayed.

Please check the error in screen shot.

Regards,

Vikash

former_member225463
Participant
0 Kudos

Hi Santhosh,

This all are related to print functionality in the frontend , but my problem is i am getting the PDF from the Odata Services and in the UI its not rendering.

Can you help on this.

Regards,

Vikash