private void NodeProcess(PdfDictionary struc, PdfIndirectReference reference)
{
PdfObject obj = struc.Get(PdfName.K);
if (obj != null && obj.IsArray())
{
PdfArray ar = (PdfArray)obj;
for (int k = 0; k < ar.Size; ++k)
{
PdfDictionary dictionary = ar.GetAsDict(k);
if (dictionary == null)
{
continue;
}
if (!PdfName.STRUCTELEM.Equals(dictionary.Get(PdfName.TYPE)))
{
continue;
}
if (ar.GetPdfObject(k) is PdfStructureElement)
{
PdfStructureElement e = (PdfStructureElement)dictionary;
ar.Set(k, e.Reference);
NodeProcess(e, e.Reference);
}
}
}
if (reference != null)
{
writer.AddToBody(struc, reference);
}
}