if (all == null || toDelete == null)
return;
for (PdfObject pi : toDelete) {
if (!pi.isIndirect())
continue;
PRIndirectReference pir = (PRIndirectReference)pi;
for (int k = 0; k < all.size(); ++k) {
PdfObject po = all.getPdfObject(k);
if (!po.isIndirect())
continue;
PRIndirectReference pod = (PRIndirectReference)po;
if (pir.getNumber() == pod.getNumber()) {
all.remove(k);
--k;
}
}
}