I am generating pdf using java and itext. When I add image that we used before in previous version of the pdf everything is fine. But when I replace it with the new one(they are both png-s) it corrupts the PDF(my PDF reader return "not a pdf or corrupted).
Are there any special things that must be set when saving the image? It gives me the same problem with jpg.
P.S. There are no exceptions thrown during the generation of the pdf.
UPDATE:
I finaly succeeded to add the image, but it was after decreasing the number of its colours.
Also I am using iText 2.0.6 (by lowagie.com)