breegee wrote > If I wrap the killindirect in 'if i = 1 then killindirect', only doing it > on > page 1, then there is no error in my pdf. But it's not replacing my image > on page 2 also.
I would propose not killing the objects at all while you are in the loop but instead adding them to some collection. After finishing the loop you can iterate over that collection and kill the objects, but do make sure you don't try to kill the same object twice. Regards, Michael. BTW, you are aware that your code does only replace images directly referenced from the page content, and that it completely ignores those in included form xobjects and patterns, and also inlined images? -- View this message in context: http://itext.2136553.n4.nabble.com/Replace-images-in-pdf-tp4660966p4660970.html Sent from the iText mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions 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