Hello together,
As we now have a marketplace you can find a PDF generation example to download at any time. Also, you can find articles on how to generate PDFs and to create a PDF template in our Knowledge Base.
In general, we still recommend to use the “PDFViewer_PDFJS” widget instead of the PDFViewer widget.
For me, these are the two main reasons:
1) The PDFViewer doesn’t display PDFs on mobile devices, but instead shows only the toolbar with a download button is visible. This limitation is still persistent in the current openui5 version 1.92, as you can see in the official documentation: sap.m.PDFViewer
2) If you want to use base64 as a source you have to use a data URI like “data:application/pdf;base64,<your-base64-encoded-pdf>”. Additionally, you have to whitelist this URI in advance. Example: “jQuery.sap.addUrlWhitelist(undefined, <your-dataURI>);”. For more information about whitelisting in openui5, have a look in the official documentation: URL Whitelist Filtering
I hope this clears up some questions.
Best,
Nina