Hi,
I have a requirement to open the pdf file in new window of Browser and pdf is stored in database as byte array. We can easily done this in Servoy webclient but the same procedure is not working in Servoy ng-client.
Any suggestions on how to open pdf in new window of Browser where pdf is stored in database as byte array ?
Thanks In Advance
So, can you explain your current approach in the Web Client? Because I am curious to learn what exactly doesn’t work in the NG Client.
Hi,
In Webclient, I used to create a js file in root folder and then open the file using , application.showURL (“/servoy-webclient” + file name , “_blank”), whereas in servoy ngclient, we are hosting the application in Tomcat application server. Not sure, how we can handle this servoy ngclient.
This can be done in exactly the same way. You could place the PDF file in the root folder of Tomcat and then show it in the same way as you have done in the Web Client. However, this file is then accessible to anyone who knows or “guesses” the URL.
A safer way (since the original file is coming from the database) is to create a web service with authentication, which returns the PDF file as a binary. By constructing the URL in such a way that it also includes proper credentials, you can show this in a separate tab in the browser, without having to physically place the file somewhere publicly on the disk.
Thanks a lot vincent for your suggestion, will implement that.
Thanks