Printing
For client-side printing, most browsers support printing the web page. You can either print the current or a special print page that you open. The page can be styled for printing with special CSS rules, and you can hide unwanted elements. You can also print other than Vaadin UI content, such as HTML or PDF.
Vaadin does not have special support for launching the printing in browser, but you can easily use the JavaScript print() method that opens the print window of the browser.
Java
See the on-line example.
You can open a browser window with a special UI for print content and automatically launch printing the content.
Java
See the .
How the browser opens the window, as an actual (popup) window or just a tab, depends on the browser. After printing, we automatically close the window with JavaScript close() call.
You can let the user open the resource using a Link component, or some other component with a PopupWindowOpener extension. When such a link or opener is clicked, the browser opens the PDF in the browser, in an external viewer (such as Adobe Reader), or lets the user save the document.
It is crucial to notice that clicking a Link or a PopupWindowOpener is a client-side operation. If you get the content of the dynamic PDF from the same UI state, you can not have the link or opener enabled, as then clicking it would not get the current UI content. Instead, you have to create the resource object before the link or opener are clicked. This usually requires a two-step operation, or having the print operation available in another view.
Java
See the on-line example.