on 03-15-2018 1:05 AM
Hi Experts
I'm trying to show a PDF File in a pop-up in SAP Web IDE (SAPUI5).
The OData service that returns the PDF File works fine.
1. When I make the call from my application, the PDF is not loaded correctly (stays in wait status), only downloads the file.
2. when I use the function read of the OData model, the response is the following:
What is the correct way to show the PDF file using the control sap.m.PDFViewer ?
If there is another way to show PDF files please indicate me.
I appreciate your help, thanks.
Regards.
Hi,
I got the same issue and, in my case, it was because I didn't specify any HTTP Header parameters in my backend method GET_STREAM.
So the default behaviour was to download directly the file rather than display it in sap.m.PDFViewer.
It was solved by adding this ABAP code in method GET_STREAM:
DATA http_header TYPE ihttpnvp.
http_header-name = 'Content-Disposition'.
http_header-value = 'inline; filename="MyPDF.pdf";'.
set_header( is_header = http_header ).
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Augusto,
the examples you are refering to concern loading files from the file system. That was not the question. How can we load stream content into the PdfViewer contro from sapui5?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Juan
You can find 3 examples of PDF Viewer on this link: https://sapui5.hana.ondemand.com/#/entity/sap.m.PDFViewer
For all the examples, you can see and download the code. Just click on the example and then there will be a button on the top right "show source code for this example".
Regards,
Auguso
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.