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
I039810
Advisor
Advisor
0 Kudos

Hi Edson

Could you share which release of SAP UI5 are you using?

From which application are you trying to open the PDF?

Thanks

Shalini

Edson
Explorer
0 Kudos
Hello Shalini. I am developing an application that generates a table, which when clicking a button, calls the odata where the PDF is hosted, when making the call, it does not appear in the PDF Viewer. The version in which I developed the app, in SAP BAS, is version 1.48 in the manifest and when I check my .yaml it appears 1.108.7
Edson
Explorer
0 Kudos
Sorry, by mistake I hit enter and my incomplete comment was generated. As I said, that is the version in which I developed or am developing the application, but I don't understand why the pdf opens that way. Thanks for your help. I look forward to your response. Greetings. EBZ