File tree Expand file tree Collapse file tree
src/main/java/ca/bc/gov/educ/grad/report/dto/reports/jasper/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 781781 <artifactId >itext</artifactId >
782782 <version >2.1.8.js8</version >
783783 <packaging >jar</packaging >
784- <file >${basedir} /lib/itext-4. 2.1.jar</file >
784+ <file >${basedir} /lib/itext-2.1.7.js7 .jar</file >
785785 </configuration >
786786 </execution >
787787 <execution >
795795 <artifactId >itext</artifactId >
796796 <version >2.1.7.js8</version >
797797 <packaging >jar</packaging >
798- <file >${basedir} /lib/itext-4. 2.1.jar</file >
798+ <file >${basedir} /lib/itext-2.1.7.js7 .jar</file >
799799 </configuration >
800800 </execution >
801801 </executions >
Original file line number Diff line number Diff line change 3131import net .sf .jasperreports .engine .export .JRPdfExporter ;
3232import net .sf .jasperreports .export .*;
3333
34+ import java .awt .font .GlyphVector ;
3435import java .io .ByteArrayOutputStream ;
3536import java .io .IOException ;
3637import java .io .InputStream ;
38+ import java .net .URL ;
3739import java .util .Arrays ;
3840import java .util .Collection ;
3941import java .util .Map ;
@@ -191,10 +193,23 @@ private JasperPrint createEmptyReport() {
191193 }
192194
193195 private void configurePdfGlyphRendering (final JasperPrint print ) {
196+ warnIfPdfGlyphRenderingUnsupported ();
194197 print .setProperty (PDF_GLYPH_RENDERER_BLOCKS_PROPERTY , PDF_GLYPH_RENDERER_BLOCKS );
195198 print .setProperty (PdfReportConfiguration .PROPERTY_GLYPH_RENDERER_ADD_ACTUAL_TEXT , Boolean .TRUE .toString ());
196199 }
197200
201+ private void warnIfPdfGlyphRenderingUnsupported () {
202+ try {
203+ com .lowagie .text .pdf .PdfContentByte .class .getMethod ("showText" , GlyphVector .class );
204+ } 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 ();
208+ LOG .warning ("PDF glyph rendering is disabled because the loaded iText jar does not support "
209+ + "PdfContentByte.showText(GlyphVector): " + source );
210+ }
211+ }
212+
198213 /**
199214 * Fills the report using the parameters and JR data source.
200215 *
You can’t perform that action at this time.
0 commit comments