Search code examples
jasper-reportsoracle-adfadobe-javascript

Silent printing on clients printer for a hospital front desk ADF project


I am working on a Hospital front desk ADF project, here I need to generate visit slips these dont require print preview.I want to get to print the slips without any print dialogs nor do I want a popup window. I tried lot of stuff found on the net but nothing solid has come up.. Tried this.print on the Jasper report, tried the same through Java but I am getting dialog. I am working on an intranet so the security aspect is out of the discussion so how so I make this work?


Solution

  • Well I found out a way to do this..

    JRPdfExporter exporter = new JRPdfExporter();
            exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT,
                                  "var pp = this.getPrintParams();pp.interactive=pp.constants.interactionLevel.silent;pp.NumCopies=1; this.disclosed= true ;this.print({bUI: false,bSilent: false,bShrinkToFit: true,printParams:pp});");
    

    This adds pdf javascript to the generated pdf.. Once the pdf is displayed on the popup page it performs the silent print.. Hope this helps someone in the future..