cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.PDFViewer Issue SAPUI5

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.

gregorw
Active Contributor
0 Kudos

andre.fischer does the ES5 System provide a service which can be used to request a PDF with $value? Would be great to us that to create a UI5 demo app that actually works for the described case.

0 Kudos

Hi Camilo,

Has your issue resolved. I too have a similar requirement and curious to know the solution.

Accepted Solutions (0)

Answers (3)

Answers (3)

MaxFou
Explorer

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

former_member587882
Discoverer

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

flotxi
Participant
0 Kudos

Hi Jordi,

have you found any answer to your issue?

I am facing the same problem.

The templates for the PDF Viewer don't help at all when you try do show a PDF, from archive for example.

Best regards,

Florian

former_member213660
Participant

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