Document Outline Links

Document Outline Links

Forum member · Jan 24, 2012
I am building a Table of Contents page for my report when it is printed to paper. Is there a way to access the page number for a given Outline's element? Another way to ask it would be, where is the Outline property/reference/link that the document uses to move to the appropriate page number? Thanks, Kaleb

Re: Document Outline Links

Support · Jan 25, 2012
Hello Kaleb, Yes, you can get the target page number of the outline using our DynamicPDF Merger for .NET product. You will need to use the TargetPagenumber property of the PdfOutlineList class to do this. Below is the sample code for it. PdfDocument pdf = new PdfDocument(@"C:\AllPageElements.pdf"); MergeDocument doc = new MergeDocument(pdf); ceTe.DynamicPDF.Merger.PdfOutlineList list = pdf.Outlines; int pagenumer = pdf.Outlines[0].TargetPageNumber; int pagenumer1 = pdf.Outlines[0].ChildOutlines[0].TargetPageNumber; string name = pdf.Outlines[0].Text; string name1 = pdf.Outlines[0].ChildOutlines[0].Text; doc.Draw(@"C:\MyDocument.pdf"); Thanks, ceTe Software Support Team.

Re: Document Outline Links

Forum member · Jan 25, 2012
Thanks, that worked