114
Views
4
Comments
How to view pdf in new tab?
Question
Application Type
Reactive

I have a pdfjsviewer block. There is a button on the screen

 When I click on that button, I should view the pdf document using pdfjsviewer on new tab. Can I know the solution?

UserImage.jpg
Puja Rani

Hi,

On button action you can add JS like this. This redirects to Screen1 in a new tab. If your screen has input parameter then that need to append those parameters too so that it makes a URL.

2023-08-28 09-08-29
Venkatesh Sundarajan

Hi Gayathri,

Please do check this link with the similar use case,

https://www.outsystems.com/forums/discussion/73748/pdf-preview-in-a-new-window-reactive/

Hope this helps!

2023-09-10 06-47-41
Shalaka Buche

Hi Gayathri,
you can use this javascript

var pdf_newTab = window.open("");

pdf_newTab.document.write(

    "

    encodeURI($parameters.BinaryData) + "'>"

);

Here , application/pdf is the mimetype . You can change it according to your file type if your file is .png or .jpeg etc . If it is an image it will be image/png .

Attaching Sample  OML.
Let me know if it works for you!

Regards,
Shalaka 


PDF.oml
2025-02-10 17-24-13
Arun Rajput

Hi @Gayathri Gali ,

You can use html attribute- target="_blank in property section of button.

Thanks,

Arun

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