[Reactive Web Previewer] Problem in Previewing File from DB
Forge component by Marcelo Ferreira
Application Type
Reactive

Hello,

In this component can I do it by only passing a binary file ? If yes then what should I pass to the URL field ? Since the URL is mandatory field. 


I tried passing empty string ("") to the URL, it wont display the binary data. and also it is downloading the file in this case. 

Thanks in advance

Can you check the database to see if it has the data to be displayed??

You shouldn't have any problem, because in the description it says


Hello @Sanket Gaikwad,

1. Yes, passing the empty string in the URL should work in your scenario.

2. Please check your logic flow that retrieves the binary from the database. Let's check if the flow ends in a 'Download' widget instead of 'End' widget.

3. I would suggest setting the previewer widget's Filename and BinaryData values from local variables.

I have attached a demo for guidance. Since the table in the demo app will be empty when you publish it on your end, so:

Step 1 - upload a PDF file of your choice 

Step 2 - click on the preview button to preview 

Hope this helps

AJ

PreviewerDemo.oml

Hi  =AJ= ,

Thanks for the help I tried the steps you mentioned but still not able to preview the pdf properly.  I even  tried publishing the oml you shared and tested, it is not previewing.  

This is how it is previewing and also I have not placed any download node yet it is downloading the pdf. The pdf file should be of any specific size ? like below 5kb or 10kb ?

Hello Sanket Gaikwad,

I have updated the .oml file did some logic changes. 

Check the attached .oml, might it will work for you now and you'll get your resolution.


Thanks.

PreviewerDemo.oml

Hi Sanket,

This issue is happened because of the google docs used in PDF expression,

I have tired another expression there and that worked for me,

"<iframe src='" + Location + "' width='" + Width + "' height='" + Height + "'></iframe>"

Please use this expression in the assignment of PDF

Please clear the browser cache and then test it,

Hope this works,

Kind regards,



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