protected internal void WriteOutlines(PdfDictionary catalog, bool namedAsNames)
{
if (newBookmarks == null || newBookmarks.Count == 0)
return;
PdfDictionary top = new PdfDictionary();
PdfIndirectReference topRef = this.PdfIndirectReference;
Object[] kids = SimpleBookmark.IterateOutlines(this, topRef, newBookmarks, namedAsNames);
top.Put(PdfName.FIRST, (PdfIndirectReference)kids[0]);
top.Put(PdfName.LAST, (PdfIndirectReference)kids[1]);
top.Put(PdfName.COUNT, new PdfNumber((int)kids[2]));
AddToBody(top, topRef);
catalog.Put(PdfName.OUTLINES, topRef);
}