views:

15

answers:

1

I am reading in template PDFs, customizing them, and appending pages before outputting the final document. What I want to do is modify the elements in the template I load before I append it to the output.

In particular I want to hide or remove images (and potentially other elements). I'm not even sure if elements in the imported page can be modified directly, if I can only add images (I haven't seen any sign of a removeImage() function) or what.

A little guidance would be greatly appreciated.

A: 

You should get hold of the book accompanying iText: iText in Action (1st or 2nd edition). It has some great examples of most things that can be done in iText.

I believe you need to iterate through the pdf references in the reader to be able to identify images. I am not sure how one would replace them, but it's probably possible.

There are other libraries that do this better, pdfnet being one of them, but this is commercial.

Jes