Hi all,I have stored PDF's in my outsystem database and managed to let people directly download them.However I would like to expose the PDF trough an direct URL.
e.g.xy.outsystem.com/Sample_App/Sample.pdfHow do I achieve this?
*Reactive APP
Hi Lukas
I believe that this will help you, because it is a similar case.
https://www.outsystems.com/forums/discussion/36621/generating-an-url-access-for-a-pdf-stored-in-an-entity/
I hope it helps you
@Diego Vitorino Thanks for your reply. Actually as I do not have the option to prevent the files from downloading (Saved to disc option is not availble in reative app) this page just downloads the file direcly
I thought that this solution that I mentioned would be useful to obtain the URL of your PDF.
Regards
Hi Lukas,
For the mentioned use case, I have created a demo application in which I have used JavaScript to preview the pdf file content without downloading the pdf file.
Solution reference link: stackoverflow
See this demo screen PreviewPdf
Refer to the attached .oml file
I hope this helps you!
Kind regards,
Benjith Sam
Awesome
Try to use this component for download pdf in reactive
https://www.outsystems.com/forge/component-overview/7529/pdfjs-viewer-reactive
Shradha
Hii Lukas
I hope the solution from @Benjith Sam is appropriate for what you are looking. You can use the direct JS to expose the PDF instead of downloading it.
window.open('/Export/PrintPdf');
The Simple HTMLs can help you -
Open in New Tab
<a href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf" target="_blank">HTML a href target _blank</a>
Open in New Window
<a href="#0" onclick="window.open('https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf');">JS window.open()</a>
Download
<a href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9487/LV_MOTOR_DOCUMENT_OF_INSURANCE.pdf" download="Nice Name of Document.pdf">HTML5 download attribute</a>