Sometimes we may have to show pdf documents in our application.Earlier SAPUI5 Developers has to use third party libraries and custom controls to achieve this requirement.Now the happy news is we no longer have to😎.
In the latest SAPUI5 version(1.48) there is a new control called sap.m.PDFViewer.Thanks to SAPUI5 development team.In this tutorial we will see simple SAPUI5 PDFViewer.
Pre-requisites
Steps
What are you waiting for? spread the news😏..
Visit PDFViewer Demo page by SAP
In the latest SAPUI5 version(1.48) there is a new control called sap.m.PDFViewer.Thanks to SAPUI5 development team.In this tutorial we will see simple SAPUI5 PDFViewer.
Pre-requisites
Steps
- Open the view and paste below code.We are using our brand new sap.m.PDFViewer and give the properties title and source.
- Now run the application.I have posted my application screenshot.
<mvc:View controllerName="odataaaa.controller.View1" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:core="sap.ui.core"> <App> <pages> <Page title="{i18n>title}"> <content> <PDFViewer title="New SAPUI5 PDFViewer" source="https://assets.cdn.sap.com/sapcom/docs/2015/07/c06ac591-5b7c-0010-82c7-eda71af511fa.pdf"> </PDFViewer> </content> </Page> </pages> </App> </mvc:View>
What are you waiting for? spread the news😏..
Visit PDFViewer Demo page by SAP
If you enjoyed this post, Please Share!!
This comment has been removed by the author.
ReplyDeleteNot possible directly.. Hope this workaround helps you. SAP BLOG -base64 url in pdfviewer
DeleteIts working Fine in Desktop mode , But not working in SAP Fiori Client App ?
ReplyDeletetry using property displayType 'Embedded'.
Delete