How can I view a pdf file from server directory using outsystems 11 traditional web?

I need to view the uploaded pdf file after uploading it on Server Directory without using any plugin? it is possible?

Hi,

You can use this forge component to view the PDF file,

https://www.outsystems.com/forge/component-overview/1281/web-previewer

Hope this helps,

Kind Regards,


Hello o_sys_tem_developer,

Yes, without using a forge component, you can still open the PDF document (in a new tab) as follows:

1. Set Url path to the file location.

2. Pass the Url to the RunJavaScript server action (available in the HTTPRequestHandler extension)

3. Set the Script property to - "window.open('" + EncodeJavaScript(Url) + "');"

I have attached the oml,

Regards,

AJ


UseJavascriptToViewPdf.oml

I already tried this approach but didnt work. The file is located at server directory/shared folder. I think by default the browser is blocking the file to be open. 

I have not had a similar use case, but I understand that this forge component is useful to read files on a shared folder. I have not tried it myself but wanted to mention it.

Hi o_sys_tem_developer,

I have tried your usecase .

herewith i have attached the sample oml and url

Hope this helps!

Regards,

Ellakkiya.S

ReferenceWEB.oml

Hi,


Facing the same issue I ended up displaying it using the browser's pdf renderer.

The pdf is displayed inside an HTML block (iframe tag):

The PDF file is stored in the database, and converted to string (base64) using "BinaryData>BinaryToBase64":


Hope it helps someone :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.