Skip to content

Commit 6576686

Browse files
authored
Merge pull request #817 from bcgov/feature/GRAD2-3666
update pom for jaspersoft
2 parents 10b05cb + f7c11f1 commit 6576686

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

api/src/main/java/ca/bc/gov/educ/grad/report/dto/reports/jasper/impl/JasperReportImpl.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import net.sf.jasperreports.engine.export.HtmlExporter;
3030
import net.sf.jasperreports.engine.export.JRCsvExporter;
3131
import net.sf.jasperreports.engine.export.JRPdfExporter;
32+
import net.sf.jasperreports.engine.export.PdfGlyphRenderer;
3233
import net.sf.jasperreports.export.*;
3334

3435
import java.awt.font.GlyphVector;
@@ -193,23 +194,30 @@ private JasperPrint createEmptyReport() {
193194
}
194195

195196
private void configurePdfGlyphRendering(final JasperPrint print) {
196-
warnIfPdfGlyphRenderingUnsupported();
197+
logPdfGlyphRenderingSupport();
197198
print.setProperty(PDF_GLYPH_RENDERER_BLOCKS_PROPERTY, PDF_GLYPH_RENDERER_BLOCKS);
198199
print.setProperty(PdfReportConfiguration.PROPERTY_GLYPH_RENDERER_ADD_ACTUAL_TEXT, Boolean.TRUE.toString());
199200
}
200201

201-
private void warnIfPdfGlyphRenderingUnsupported() {
202+
private void logPdfGlyphRenderingSupport() {
202203
try {
203204
com.lowagie.text.pdf.PdfContentByte.class.getMethod("showText", GlyphVector.class);
205+
final URL source = getPdfContentByteSource();
206+
LOG.info("PDF glyph rendering support detected. Jasper supported="
207+
+ PdfGlyphRenderer.supported()
208+
+ ", iText source=" + source);
204209
} catch (final NoSuchMethodException ex) {
205-
final URL source = com.lowagie.text.pdf.PdfContentByte.class.getProtectionDomain().getCodeSource() == null
206-
? null
207-
: com.lowagie.text.pdf.PdfContentByte.class.getProtectionDomain().getCodeSource().getLocation();
208210
LOG.warning("PDF glyph rendering is disabled because the loaded iText jar does not support "
209-
+ "PdfContentByte.showText(GlyphVector): " + source);
211+
+ "PdfContentByte.showText(GlyphVector): " + getPdfContentByteSource());
210212
}
211213
}
212214

215+
private URL getPdfContentByteSource() {
216+
return com.lowagie.text.pdf.PdfContentByte.class.getProtectionDomain().getCodeSource() == null
217+
? null
218+
: com.lowagie.text.pdf.PdfContentByte.class.getProtectionDomain().getCodeSource().getLocation();
219+
}
220+
213221
/**
214222
* Fills the report using the parameters and JR data source.
215223
*

0 commit comments

Comments
 (0)