Home > Forum > General > [SOLVED] Open PDF in a popup

[SOLVED] Open PDF in a popup
0

MVP

Hello everyone!

I have the following challenge. I need to open the pdf attached to a workflow in a popup. I successfully managed to do so using the base64 encoded string and some javascript. Now the problem is that the pdfs are larger than expected. Some of them are 5MB and even more. For those large pdfs the script is not working, nor is effective to try make it work.

I can go the Python way, create a server-side endpoint that would serve the PDF to, e.g. PDF.js. But I was wondering if there is any other solution, maybe something based on the scripts included in Webcon?

Any help would be much appreciated.

Cheers,
Martin

MVP

Hi Martin,
Could you give us some more informations?
When you want to open in, by popup you mean new browser window, or just html element?

There is a checkbox on the form configuration page, when you have attachments selected, that will allow users to open attachment in new window, which they could just drag out to new browser instance:
https://docs.webcon.com/docs/2023R2/Studio/Workflow/Forms/module_2_4_7_6_1#open-in-new-window


Also, there is built in HTML popup, when you select 'Attachment preview' on the form template, in Properties you will find 'Show in dialog' (not sure how it's in en version, don't have one at this moment, hopefully screenshot will help).