/** * Creates a new instance of PdfStructureElement. * @param parent the parent of this node * @param structureType the type of structure. It may be a standard type or a user type mapped by the role map */ public PdfStructureElement(PdfStructureElement parent, PdfName structureType) { top = parent.top; Init(parent, structureType); this.parent = parent; Put(PdfName.P, parent.reference); }
private void NodeProcess(PdfDictionary struc, PdfIndirectReference reference) { PdfObject obj = struc.Get(PdfName.K); if (obj != null && obj.IsArray() && !((PdfObject)((PdfArray)obj).ArrayList[0]).IsNumber()) { PdfArray ar = (PdfArray)obj; ArrayList a = ar.ArrayList; for (int k = 0; k < a.Count; ++k) { PdfStructureElement e = (PdfStructureElement)a[k]; a[k] = e.Reference; NodeProcess(e, e.Reference); } } if (reference != null) { writer.AddToBody(struc, reference); } }