예제 #1
0
        /// <summary>
        /// Inits this instance.
        /// </summary>
        private void Init()
        {
            base.Add(PdfName.Type, PdfName.Catalog);
            PdfPageTree tree = new PdfPageTree(this.pdf)
            {
                IsLabeled = true,
                IsFix     = true
            };
            PdfDictionary dictionary = tree;

            base.Add(PdfName.Pages, dictionary);
        }
예제 #2
0
        /// <summary>
        /// Scans the page tree and create outline.
        /// </summary>
        /// <param name="pages">The pages.</param>
        /// <param name="outline">The outline.</param>
        private void ScanPageTreeAndCreateOutline(PdfPageTree pages, PdfOutlineItem outline)
        {
            List <PdfOutlineItem> list = (outline == null) ? this.outlines.Items : outline.ChildItems;

            foreach (PdfObjectBase base2 in pages.Kids)
            {
                if (base2 is PdfPage)
                {
                    list.Add(new PdfOutlineItem((PdfPage)base2));
                }
                else
                {
                    PdfOutlineItem item = new PdfOutlineItem();
                    list.Add(item);
                    this.ScanPageTreeAndCreateOutline((PdfPageTree)base2, item);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Creates the default page outlines.
        /// </summary>
        public void CreateDefaultPageOutlines()
        {
            PdfPageTree pages = this.Pages;

            this.ScanPageTreeAndCreateOutline(pages, null);
        }