Please disable your adblock and script blockers to view this page

Search this blog

Showing posts with label Print Dialog. Show all posts
Showing posts with label Print Dialog. Show all posts

Thursday 5 January 2017

Get Installed Printer List using Java, Print a file with default Printer

This post shows that how can we get installed printers list using PrintServiceLookup class

Implementations of this class provide lookup services for print services

Saturday 8 March 2014

Launching browser print dialog using simple javascript function in ADF

Hello All ,
This posts talks about a requirement of printing a simple page (not much component as, form,tree,etc & not much data)
you can use a simple one liner javascript function to invoke browser's print dialog.

  • there is a page with Departments table on it, and a button to print this page

  • Called this simple javascript function on button click to open print dialog

  • window.print();

  • to execute javascript through managed bean use this method 

  •     /**Method to execute Javascript
         * @param javascriptCode
        public static void runJavaScriptCode(String javascriptCode) {
            FacesContext facesCtx = FacesContext.getCurrentInstance();
            ExtendedRenderKitService service = Service.getRenderKitService(facesCtx, ExtendedRenderKitService.class);
            service.addScript(facesCtx, javascriptCode);

  • click on print button- In Google Chrome

In Mozilla-

after printing, the page look like this
Sample ADF Application- Download
Cheers :-)