private void outlineTravel(PRIndirectReference outline) { while (outline != null) { PdfDictionary outlineR = (PdfDictionary) PdfReader.getPdfObjectRelease(outline); PRIndirectReference first = (PRIndirectReference) outlineR.get(PdfName.FIRST); if (first != null) { outlineTravel(first); } PdfReader.killIndirect(outlineR.get(PdfName.DEST)); PdfReader.killIndirect(outlineR.get(PdfName.A)); PdfReader.killIndirect(outline); outline = (PRIndirectReference) outlineR.get(PdfName.NEXT); } }
private void outlineTravel(PRIndirectReference outline) { while (outline != null) { PdfDictionary outlineR = (PdfDictionary) PdfReader.getPdfObjectRelease(outline); PRIndirectReference first = (PRIndirectReference) outlineR.get(PdfName.FIRST); if (first != null) { outlineTravel(first); } PdfReader.killIndirect(outlineR.get(PdfName.DEST)); PdfReader.killIndirect(outlineR.get(PdfName.A)); PdfReader.killIndirect(outline); outline = (PRIndirectReference) outlineR.get(PdfName.NEXT); } }
void sweepKids(PdfObject obj) { PdfObject oo = PdfReader.killIndirect(obj); if (oo == null || !oo.isDictionary()) return; PdfDictionary dic = (PdfDictionary) oo; PdfArray kids = (PdfArray) PdfReader.killIndirect(dic.get(PdfName.KIDS)); if (kids == null) return; for (int k = 0; k < kids.size(); ++k) { sweepKids(kids.getPdfObject(k)); } }
void sweepKids(PdfObject obj) { PdfObject oo = PdfReader.killIndirect(obj); if (oo == null || !oo.isDictionary()) return; PdfDictionary dic = (PdfDictionary) oo; PdfArray kids = (PdfArray) PdfReader.killIndirect(dic.get(PdfName.KIDS)); if (kids == null) return; for (int k = 0; k < kids.size(); ++k) { sweepKids(kids.getPdfObject(k)); } }
PdfReader.killIndirect(oldEmbeddedFiles);
void deleteOutlines() { PdfDictionary catalog = reader.getCatalog(); PdfObject obj = catalog.get(PdfName.OUTLINES); if (obj == null) return; if (obj instanceof PRIndirectReference) { PRIndirectReference outlines = (PRIndirectReference) obj; outlineTravel(outlines); PdfReader.killIndirect(outlines); } catalog.remove(PdfName.OUTLINES); markUsed(catalog); }
void deleteOutlines() { PdfDictionary catalog = reader.getCatalog(); PdfObject obj = catalog.get(PdfName.OUTLINES); if (obj == null) return; if (obj instanceof PRIndirectReference) { PRIndirectReference outlines = (PRIndirectReference) obj; outlineTravel(outlines); PdfReader.killIndirect(outlines); } catalog.remove(PdfName.OUTLINES); markUsed(catalog); }
PdfReader.killIndirect(oldEmbeddedFiles);
markUsed(annots); PdfReader.killIndirect(ref); PdfIndirectReference kid = ref; while ((ref = wd.getAsIndirectObject(PdfName.PARENT)) != null) { break; kid = ref; PdfReader.killIndirect(ref);
markUsed(annots); PdfReader.killIndirect(ref); PdfIndirectReference kid = ref; while ((ref = wd.getAsIndirectObject(PdfName.PARENT)) != null) { break; kid = ref; PdfReader.killIndirect(ref);
void eliminateAcroformObjects() { PdfObject acro = reader.getCatalog().get(PdfName.ACROFORM); if (acro == null) return; PdfDictionary acrodic = (PdfDictionary) PdfReader.getPdfObject(acro); reader.killXref(acrodic.get(PdfName.XFA)); acrodic.remove(PdfName.XFA); PdfObject iFields = acrodic.get(PdfName.FIELDS); if (iFields != null) { PdfDictionary kids = new PdfDictionary(); kids.put(PdfName.KIDS, iFields); sweepKids(kids); PdfReader.killIndirect(iFields); acrodic.put(PdfName.FIELDS, new PdfArray()); } acrodic.remove(PdfName.SIGFLAGS); acrodic.remove(PdfName.NEEDAPPEARANCES); acrodic.remove(PdfName.DR); // PdfReader.killIndirect(acro); // reader.getCatalog().remove(PdfName.ACROFORM); }
void eliminateAcroformObjects() { PdfObject acro = reader.getCatalog().get(PdfName.ACROFORM); if (acro == null) return; PdfDictionary acrodic = (PdfDictionary) PdfReader.getPdfObject(acro); reader.killXref(acrodic.get(PdfName.XFA)); acrodic.remove(PdfName.XFA); PdfObject iFields = acrodic.get(PdfName.FIELDS); if (iFields != null) { PdfDictionary kids = new PdfDictionary(); kids.put(PdfName.KIDS, iFields); sweepKids(kids); PdfReader.killIndirect(iFields); acrodic.put(PdfName.FIELDS, new PdfArray()); } acrodic.remove(PdfName.SIGFLAGS); acrodic.remove(PdfName.NEEDAPPEARANCES); acrodic.remove(PdfName.DR); // PdfReader.killIndirect(acro); // reader.getCatalog().remove(PdfName.ACROFORM); }
PdfDictionary wd = (PdfDictionary) PdfReader.getPdfObject(wdref); PRIndirectReference parentRef = (PRIndirectReference) wd.get(PdfName.PARENT); PdfReader.killIndirect(wdref); if (parentRef == null) { // reached AcroForm for (int fr = 0; fr < acroFds.size(); ++fr) { PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS); PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS);
PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS);
if (xmpo != null && xmpo.isStream()) { altMetadata = PdfReader.getStreamBytesRaw((PRStream) xmpo); PdfReader.killIndirect(catalog.get(PdfName.METADATA));
if (xmpo != null && xmpo.isStream()) { altMetadata = PdfReader.getStreamBytesRaw((PRStream) xmpo); PdfReader.killIndirect(catalog.get(PdfName.METADATA));
PdfDictionary wd = (PdfDictionary) PdfReader.getPdfObject(wdref); PRIndirectReference parentRef = (PRIndirectReference) wd.get(PdfName.PARENT); PdfReader.killIndirect(wdref); if (parentRef == null) { // reached AcroForm for (int fr = 0; fr < acroFds.size(); ++fr) { PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS); PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS);
PdfReader.killIndirect(pageDic.get(PdfName.ANNOTS)); pageDic.remove(PdfName.ANNOTS);