'PDFCleanUpProcessor just remove text

Is there a way to get the PDFCleanUpProcessor from Itext to just remove text and not other items?

The code i've got here removes part of a table border as well as the text from the PDF

I guess thats because its replacing the text with the White Rectangle defined in the cleanuplocations list?

Can i perhaps use a blank rectangle instead of white.

I don't want to remove the table border, just any text found within the rectangle area 

List<PdfCleanUpLocation> cleanUpLocations = new ArrayList<PdfCleanUpLocation>();            
for (int x = 1; x <= pagecount; x++) {                                
   if(x == pages.get(rectscount))  {                    
   Rectangle rect = rects.get(rectscount)
   cleanUpLocations.add(new PdfCleanUpLocation(x, rect,BaseColor.WHITE));                    
   rectscount++;                
   }            
}            //System.out.println(cleanUpLocations.size());            
PdfCleanUpProcessor cleaner = new PdfCleanUpProcessor(cleanUpLocations, stamper);            
cleaner.cleanUp();


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source