public void CopyStructTreeForPage(PdfNumber sourceArrayNumber, int newArrayNumber)
{
if (!openedDocuments[fileName])
{
PdfObject res = writer.CopyObject(writer.CopyObject(structTreeRoot.Get(PdfName.K), true, true));
if (!(res is PdfIndirectReference))
{
res = writer.AddToBody(res).IndirectReference;
}
structureTreeRoot.AddPageMark(newArrayNumber, (PdfIndirectReference)res);
AddKid(structureTreeRoot, res);
openedDocuments.Add(fileName, true);
}
if (CopyPageMarks(parentTree, sourceArrayNumber, newArrayNumber) == returnType.NOTFOUND)
{
throw new BadPdfFormatException(MessageLocalization.GetComposedMessage("structparent.not.found"));
}
}