I'm trying to get a silent print of my PDF report at client/browser. Unfortunately, I can't be quite successful in this. My silent print command comes to browser with the PDF document and when I open this there's a dialog stating "this document is trying to print", now if I click ok, the document gets printed. But I need to print the document silently without opening and without showing any dialog (not download dialog too).


The code block for setting exporter with silent print parameter is as follows:

OutputStream outputStream = new FileOutputStream(outputFile);
          exporter = new JRPdfExporter();
          exporter.setParameter(JRPdfExporterParameter.CHARACTER_ENCODING, "UTF-8");
          exporter.setParameter(JRExporterParameter.JASPER_PRINT, jp);
          exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT,"this.print({bUI: false,bSilent: true,bShrinkToFit: false});");
          exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, outputStream);


Can anyone help me resolve this or at least let me know if it's possible or not?