I'm using this code to produce a PDF, all works well.
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(new File(reportname));
JRDataSource ds = ... a datasource
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, d.getHashMap(), ds);
JasperExportManager.exportReportToPdfFile(jasperPrint, output_path + "p4.pdf");
When I try to produce a pdf compliant pdfa1b I obtains this exception
Exception in thread "main" java.lang.NullPointerException
at com.itextpdf.text.pdf.internal.PdfA1Checker.checkPdfObject(PdfA1Checker.java:323)
at com.itextpdf.text.pdf.internal.PdfAChecker.checkPdfAConformance(PdfAChecker.java:208)
at com.itextpdf.text.pdf.internal.PdfAConformanceImp.checkPdfIsoConformance(PdfAConformanceImp.java:71)
at com.itextpdf.text.pdf.PdfWriter.checkPdfIsoConformance(PdfWriter.java:3426)
at com.itextpdf.text.pdf.PdfWriter.checkPdfIsoConformance(PdfWriter.java:3422)
at com.itextpdf.text.pdf.PdfDictionary.toPdf(PdfDictionary.java:137)
at com.itextpdf.text.pdf.PdfArray.toPdf(PdfArray.java:175)
at com.itextpdf.text.pdf.PdfDictionary.toPdf(PdfDictionary.java:149)
at com.itextpdf.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:158)
at com.itextpdf.text.pdf.PdfWriter$PdfBody.write(PdfWriter.java:420)
at com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:398)
at com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:334)
at com.itextpdf.text.pdf.PdfWriter.addToBody(PdfWriter.java:829)
at com.itextpdf.text.pdf.PdfWriter.close(PdfWriter.java:1311)
at com.itextpdf.text.pdf.PdfAWriter.close(PdfAWriter.java:336)
at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:886)
at com.itextpdf.text.Document.close(Document.java:416)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:830)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:519)
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfFile(JasperExportManager.java:157)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:505)
at ga.jr.run.RunMe.main(RunMe.java:45)
this is a portion of my jasper file
<property name="net.sf.jasperreports.export.pdf.tagged" value="true"/>
<property name="net.sf.jasperreports.export.pdfa.conformance" value="pdfa1b"/>
<property name="net.sf.jasperreports.export.pdfa.icc.profile.path" value="Z:\\Produzione\\Development\\TEMPLATE\\sRGB_v4_ICC_preference.icc"/>
No exception if I remove the net.sf.jasperreports.export.pdfa.conformance (or set it to "none"), but the file is not a PDF/A
what is wrong? thanks
EDIT: I'm using iText 5.5.3 (same issue using itext 5.5.0) and Jasperreports 6.0.0
EDIT: tested using AdobeRGB1998.icc and sRGB_v4_ICC_preference.icc, ISOnewspaper26v4_gr.icc and ISOnewspaper26v4.icc, eciRGB_v2.icc and ISOcoated_v2_300_eci.icc (found in my PDFCreator installation directory) same exception
This is a bug. I reverted to version 5.6.1 and all works ok.
Today is 17/12/2014 and I'm waiting for a Jasperreports version above 6.0.0.
Bug documented at http://community.jaspersoft.com/jasperreports-library/issues/3988