cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying PDF on mobile device

hseyin_erbek
Participant
0 Kudos

Hi Experts,

My split app. (XML view) is displaying pdf in detail page.It is working on desktop but  when I am using on mobile device it just displays blank page. What should I do ?


Best Regards,

Hüseyin.

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor

Rendering PDFs on mobile is the Achilles heel of PDF. It is just not done well. I have seen some 3rd party apps/solutions, but even then...if is is a static PDF, you are ok....anything else, and it is just bad.....which is why I think Adobe has been working on their HTML5 conversion product. They have talked about it now for the last several TechEds.

hseyin_erbek
Participant
0 Kudos

Matester.conntroler.js



handleListSelect : function (evt) {
....
var sURI = '/sap/opu/odata/sap/ZHE_FAT_ONAY_SRV' + sRead + '/$value';


  
try{
  
var detailController = sap.ui.demo.myFiori._detailController;
  
var form = detailController.getView().byId("Fatura2");
  
var content = form.getContent()[0];
  content
.getDomRef();
  jQuery
(content.getDomRef()).attr('src',sURI);
  content
.rerender();
  
}
  
catch(e){
  jQuery
.sap.log.warning("failed to set resource");
  
}  
  
this.nav.to("Detail", context);
},



Detail.conttroller.js


onAfterRendering: function(){
  sap
.ui.demo.myFiori._detailController  = this;
},

What is the missing part ?

vijay_kumar49
Active Contributor
0 Kudos

try this

  1. var oButton = new sap.ui.commons.Button({ 
  2.        id : 'B-Create'
  3.        text : 'Display PDF'
  4.        width : '10em'
  5.        press : function(){ 
  6.        var sRead = "/pdfset(customer='" + oTF.getValue() + "')" + "/$value"
  7.      
  8.        oModel.read( sRead, null, null, true, function(oData, oResponse){ 
  9.                      var pdfURL = oResponse.requestUri;              
  10.             html.setContent("<iframe src=" + pdfURL + " width='700' height='700'></iframe>"); 
  11.             oPanel.addContent(html); 
  12.             oPanel.placeAt("content"); 
  13.           
  14.                      
  15.         },function(){ 
  16.             alert("Read failed");}); 
  17.             
  18.        } 
  19.        }); 
hseyin_erbek
Participant
0 Kudos

I tried its same dektop fine but but mobile display blank page

vijay_kumar49
Active Contributor
0 Kudos

that's the browser functionality.use pdf.js

hseyin_erbek
Participant
0 Kudos

Thanks Vijay it works

Answers (1)

Answers (1)

Former Member
0 Kudos

This message was moderated.