/// <summary>Create PdfPages tree.</summary> /// <param name="pdfCatalog"> /// /// <seealso>PdfCatalog</seealso> /// </param> public PdfPagesTree(PdfCatalog pdfCatalog) { this.document = pdfCatalog.GetDocument(); this.pageRefs = new List <PdfDictionary>(); this.parents = new List <PdfPages>(); this.pages = new List <PdfPage>(); if (pdfCatalog.GetPdfObject().ContainsKey(PdfName.Pages)) { PdfDictionary pages = pdfCatalog.GetPdfObject().GetAsDictionary(PdfName.Pages); if (pages == null) { throw new PdfException(PdfException.InvalidPageStructurePagesPagesMustBePdfDictionary); } this.root = new PdfPages(0, int.MaxValue, pages, null); parents.Add(this.root); for (int i = 0; i < this.root.GetCount(); i++) { this.pageRefs.Add(null); this.pages.Add(null); } } else { this.root = null; this.parents.Add(new PdfPages(0, this.document)); } }
/// <summary>Creates the NumberTree of current Document</summary> /// <param name="catalog">Document catalog</param> /// <param name="treeType">the type of tree. ParentTree or PageLabels.</param> public PdfNumTree(PdfCatalog catalog, PdfName treeType) { this.treeType = treeType; this.catalog = catalog; }
/// <summary>Creates the NameTree of current Document</summary> /// <param name="catalog">Document catalog</param> /// <param name="treeType">the type of tree. Dests Tree, AP Tree etc.</param> public PdfNameTree(PdfCatalog catalog, PdfName treeType) { this.treeType = treeType; this.catalog = catalog; items = GetNames(); }