How to open a PDF file in pdf reader with vaadin?

694 Views Asked by At

A new Programmer here.

I was searching about open a PDF file with vaading. I can open it in the browser or download it without problem, but i need to open in a tab of my application, or at least open it in the predefined pdf reader and the Desktop class is not an option.

Can anyone help me? I only saw browser options, and now i was in war with the WT PDF Viewer class trying it.

Thank you a lot!

1

There are 1 best solutions below

0
On

If you are using Vaadin 7 & 8, one possibility is to use Embedded since accepts Resource as parameter see API for Vaadin 8 here https://vaadin.com/api/framework/8.6.0/com/vaadin/ui/Embedded.html and Resource here https://vaadin.com/api/framework/8.6.0/com/vaadin/server/Resource.html You probably would use StreamResource .