Must set the PDFAWriter ColorProfile before getting a new page

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Must set the PDFAWriter ColorProfile before getting a new page

Alain Brion

I use iTextSharp to create PDF/A documents with links

I spent several hours to fix an issue in my code.

I got a null-reference exception when calling newPage() after putting a link (PDFAction) in previous page.

I had to debug inside the source of the PDF/A part to figure out that the ColorProfile is to be assigned into the PDFWriter before doing anything (I was assigning it just before closing the document).

So I just want to suggest to add a check on this case

In PdfA1Checker.cs, after line 422 (version 5.5.7), throw an exception if the colorProfile is null with a text complaining about the ColorProfile being null in the PDFWriter. This would help developers to fix this issue.




iText-questions mailing list
[hidden email]

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php