cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when opening a PDF in my SAPUI5 app

Edson
Explorer
0 Kudos

Hello Experts, good day.

I have the following doubt.

We are using PDFViewer to be able to view a PDF document in a fiori app.

The problem is that when we call it, PDFViewer does not show the PDF and immediately afterward, it opens a window to download the file.

Edson_0-1713218792595.png

Edson_1-1713218890816.png

Do you know why this is happening?

This is the code I use for the PDFViewer.

 

 

                var sServiceURL = ".../ZFI_LIBRO_INV_PDF_SRV";
                var sSource = sServiceURL + "/pdfSet('" + sociedad + "," +  ejercicio + "," + perContable + "," + ledger + "," + A4Digitos +"')/$value";

                    var opdfViewer = new PDFViewer({
                        loaded: function (oEvent) {
                     }, error: function (oError) {                            
                     }, sourceValidationFailed: function (oEvent) {
                     } });
                    
                     opdfViewer.setSource(sSource);
                     opdfViewer.setTitle("Libro Inventario");
                     opdfViewer.open();  

 

 

Could it be how the PDF was created in Odata that is causing this? Or is it some particular issue about how my call was made?

Any help is welcome.

And I can't tell you how the Odata was made or so, since I don't have access to that part of the Project due to permissions issues.

Thanks so much for reading

Greetings

EBZ.



View Entire Topic
burakozctn
Explorer
0 Kudos

Hi, Can you share backend code please? 

Did you check mime type and file name extension?

for ex: pdf/application

for ex: XXXXX.pdf

 

Edson
Explorer
0 Kudos
Hello, Sorry, but I do not have access to the code with which the Odata was generated to obtain the PDF file, the ABAP that shared the information with me, only gave me the url, which must be filled with some parameters separated by a , to call it, it is the The only information I have, that's why I don't know, because when accessing with PDFViewer it is downloaded and not previewed.