Created
May 2, 2017 17:24
-
-
Save bvanzyl/eaa6834f15dca86dced6ce61d9648bb1 to your computer and use it in GitHub Desktop.
[Inject PDF in SAPUI5 View] #tags:SAPUI5,PDF,View,HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oModel = new sap.ui.model.json.JSONModel("./model/mockdata2/Smartform.json"); | |
oModel.attachRequestCompleted(function(some){ | |
var htmlTag = this.getView().byId("html_tag"); | |
if(this.getView().getModel("pdfModel").oData[0].Smartform){ | |
htmlTag.setContent("<iframe src=\"data:application/pdf;base64," + | |
this.getView().getModel("pdfModel").oData[0].Smartform + | |
" \" width=\"100%\" height=\"600px%\" />"); | |
} | |
htmlTag.setBusy(false); | |
}.bind(this)); | |
this.getView().setModel(oModel, "pdfModel"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<core:HTML id="html_tag" visible="{device>/system/desktop}" busy="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<core:HTML | |
visible="{device>/system/desktop}" | |
content='<iframe src="http://www.pdf995.com/samples/pdf.pdf" width="100%" height="600px%" />' /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment