title: How to compress PDF in JasperReports
body: <p>How do I apply the <code>IS_COMPRESSED = true</code> property to a Jasper PDF report? </p>
  
  <p>This is what I have but when I create a PDF report it is the same size as it's clone without compression enabled:</p>
  
  <pre><code>File pdfFile = new File (pdfDirectory.getAbsolutePath() + File.separator +  reportName + ".pdf");
  File jrPrintFile = new File(jrprintFileLocation.getAbsolutePath() + File.separator + templateName + ".jrprint");
  
  JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(jrPrintFile);
  
  JRPdfExporter jrPdfExporter = new JRPdfExporter();
  
  jrPdfExporter.setParameter(JRPdfExporterParameter.IS_COMPRESSED, true);
  jrPdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
  jrPdfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, pdfFile.getAbsolutePath());
  
  jrPdfExporter.exportReport();
  </code></pre>