public void cleanup(PdfCanvas cb){
  int k=savedStates.size();
  while (k-- > 0)   cb.restoreState();
}

public void cleanup ( PdfCanvas cb ) { int k = savedStates . size ( ) ; while ( k -- > 0 ) cb . restoreState ( ) ; }
restres the state of the specified pdfcanvas object for as many times as there are saved states on the stack .
