1
问:为什么保存为PDF时字母信息丢失?jasper报告中忽略半透明(半透明)背景颜色pdf导出
Jaspersoft studio不允许我用alpha指定颜色。于是,我就在我的阴影元素巧妙的与指定的键和代码改变了颜色,像这样:
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(getClass().getResourceAsStream("/reports/Test.jasper"));
((JRStaticText) jasperReport.getGroups()[0].getGroupHeaderSection().getBands()[0].getElementByKey("bg")).setBackcolor(new Color(0, 0, 0, 30));
((JRRectangle) jasperReport.getGroups()[0].getGroupFooterSection().getBands()[0].getElementByKey("bg")).setBackcolor(new Color(0, 0, 0, 30));
只是为了看看它使我同时使用JRStaticText和JRRectangle的差异。纸上的预览和实际打印效果非常好。它也适用于打印到PDFCreator。但是当我从JRViewer/JasperViewer保存为PDF时,生成的PDF将以不透明的黑色显示。
预览/纸打印/ PDFCreator的:
Jasper报表PDF保存/导出:
使用Studio 6.2.0,导出到TIFF会保持透明度,但导出到PDF会忽略透明度。 – jgrocha 2016-02-28 22:33:07
UGH。有没有标志或某种方式来保持PDF的透明度? – Booyah 2016-11-28 19:25:42