Problem with setting default color space.
Hi Bruno,
I am setting the default color space in the following...
BatchFillPDFX batch = new BatchFillPDFX();
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(targetFile));
writer.setDefaultColorspace(PdfName.DEFAULTCMYK, null);
PdfDictionary dic = writer.getDefaultColorspace();
System.out.println(dic + "----" + dic.size());
writer.setPDFXConformance(PdfWriter.PDFX32002);
FontFactory.registerDirectories();
writer.setPageEvent(batch);
document.open();
//some code.
document.newPage();
//at the end
document.close();
This throwing an exception at document.newPage(), it is NullPointerException. Is there anything wrong in this code.
-- ganesh.