« Return to Thread: Problem with setting default color space.

Problem with setting default color space.

by GaneshPrakhya :: Rate this Message:

Reply to Author | View in Thread

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.

 « Return to Thread: Problem with setting default color space.