我使用这种方法在java中生成PDF:
...
JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, sTempPath);
virtualizer.setReadOnly(false);
map.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
map.put(JRParameter.REPORT_LOCALE, Locale.ITALIAN);
JasperPrint print = JasperFillManager.fillReport(report, map, conn.getConnection());
JasperExportManager.exportReportToPdfFile(print, reportNameSaveTo);
...
现在我必须通过设置pdf的“压缩”来优化大小,我该怎么做?
答案 0 :(得分:0)
您可以在jasperreports.properties中设置net.sf.jasperreports.export.pdf.compressed = true,或在code中执行等效的操作。