Learn how to display and download PNG, JPG, and PDF documents in the SAP Fiori Client on Android. This guide covers using a third-party app for zooming and accessing additional options for a seamless document handling experience. Ideal for enhancing your mobile document management capabilities.
Fiori Client’s Zoom Options
How can ZOOM options be brought in?
What is the process for opening a document using a third-party application?
The built-in Fiori Client attachment plugin, is the answer.
The code snippet to accomplish the functionality is shown below.
- Display the document
Put the code below on the unified uploader’s change event.
var oCore = sap.ui.getCore(); var oFile = oEvent.oSource.oFileUpload.files[0]; if (oFile) { var vPath = URL.createObjectURL(oFile); try { if (oFile.type == "application/pdf") { // For mime type PDF this below code invokes adobe reader var reader = new FileReader(); reader.readAsDataURL(oFile); reader.onload = function() { window.open(reader.result); }; reader.onerror = function(error) { sap.m.MessageToast .show("Unable to open file"); }; } else { // For mime type JPG PNG this below code invokes gallery window.open(vPath); } } catch (e) { // Error in case of any failures to be catched }
2. View the document after downloading from Getstream.
try { window .open(encodeURI("/sap/opu/odata/Service/AttachSet(Property1='" + vValue1 + "',Property2='" + vValue2 + "')/$value")); } catch (e) { // Error in case of any failures to be catched }
Shots showing how to operate it.
Launch the Fiori Client App.
Select on browse button
Select an image that requires the user to enlarge before proceeding with any actions.
Zoom options will be accessible as soon as the file uploader’s change function is called.
Select a PDF file to open the PDF app and access the zoom features
See Also: Complete Guide for My Inbox PO Approval Application
Likewise, if you need to use Getstream to open the Adobe Reader or gallery/in-app window. Utilize the download feature. The associated app is automatically invoked based on the backend’s mime type.
I think this post will give you the guidance you need to activate and call the appropriate Zoom feature routines. Please feel free to contact me or post your questions in the comments area below if you need any additional information or if you have any more questions.
you may be interested in this Blog here:-
SAP S/4HANA Cloud Public Edition 2408: A Comprehensive Guide to Product Implementation