iText - remove previously inserted over content text - Help Needed
posted 5 years ago
Hi, I could really do with some urgent help on this. Searching the Web to get a good example on this issue is very scarce.
Basically my requirement is that I stamp existing PDF documents with certain text and save it. This I have working fine(& Lots of examples on the Web). However, if later on I want to remove the text that I added to the PDF, I am having problems with. There is very little information on how this is done - Its like a BIG SECRET!!
To add my text as an over stamp, I do something like this which works fine:
REMOVING The Text...
I found someting which indicated that removing the added text requires a lot more work. Whereby, a program would need to read the individual pages resources & remove XOBJECT's. So I have this peice of code:
Apparently the calling of is supposed to remove the XOBJECT elements in that page of the PDF & thus remove the over context text that exists in the PDF. However, When I run this code, nothing gets removed. Infact, when debugging I dont see any XOBJECTs at all!