i want to open a local PDF file in my sapui5 app, when i click a button.
Have anyone an idea, how could I solve this.
onOpenDoku: function(oEvt) {
//alert("Test für Dokumentenanzeige");
var pdfViewer = new sap.m.PDFViewer();
this.getView().addDependent(pdfViewer);
//var oSample1Model = new sap.ui.model.json.JSONModel({
//Source: sap.ui.require.toUrl("file:///C:/Test/TestDatei.pdf")
//});
//this.byId('DOKU_BUTTON').setModel(oSample1Model);
//var sSource = oEvt.getSource().getModel().getData().Source;
var sSource ="file:///C:/Test/TestDatei.pdf";
pdfViewer.setSource(sSource);
pdfViewer.setTitle("My Custom Title");
pdfViewer.open();
//this.onShowDoku();
},