Print Service for Vaadin; How to print a page in vaadin?

Hi, I am working on an application which books tickets for football matches.
After the booking part , I need to give the option to print the tickets.

I searched for vaadin -addons, but I couldn’t find any add-on for Vaadin 7. I do not want to export it to a PDF and then print it. I want to print it directly from the web page.
If any one has a solution, please help me.

Thanks in advance,
Kishor

You could just build your tickets using vaadin components in a new Vaadin Window and then call javascript.execute(“print()”);

https://vaadin.com/book/-/page/advanced.printing.html

Hi,

You’re unlikely to find any add-ons, as what you’re asking for is quite tricky!

The only thing you can really do is generate a pure HTML page with a javascript call to window.print - which will kick off the browser’s print dialog box.

You’ll get very little control over how the layout printed document appears though - that is why 99% of all “printing” from web pages goes via PDF.

What you can’t do is avoid the “print” dialog.

It’s also possible to add “javascript” to a PDF document, so that when it’s opened, the PDF Reader’s Print dialog is displayed.

In summary, though - if you want pretty/precise control over the printed document, PDF really is the way to go. Other than that, generate a clean HTML document, with javascript call to window.print, and open it in a new window from Vaadin.

Cheeers,

Charles.