We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Toc page is not display when open with adobe acrobat reader BUG

We are an old customer of Aspose and we are using version 18.1.0 of Aspose pdf. ( we can’t upgrade because it’s very cost )

and I notice that we can generate the table of the content page and it’s visible in the browser ( chrome and ME ) but in adobe acrobat reader it’s not display anything but still can click

this is block of code :

**            Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
        Page tocPage = doc.Pages.Add();
        TocInfo tocInfo = new TocInfo();

        //set LeaderType
        tocInfo.LineDash = TabLeaderType.Solid;
        TextFragment title = new TextFragment("Table Of Contents");
        title.TextState.FontSize = 12;
        tocInfo.Title = title;

        //Add the list section to the sections collection of the Pdf document
        tocPage.TocInfo = tocInfo;
        //Define the format of the four levels list by setting the left margins
        //text format settings of each level

        tocInfo.FormatArrayLength = 4;
        tocInfo.FormatArray[0].Margin.Left = 0;
        tocInfo.FormatArray[0].Margin.Right = 30;
        tocInfo.FormatArray[0].LineDash = TabLeaderType.None;
        tocInfo.FormatArray[0].TextState.ForegroundColor = Color.Red;
        tocInfo.FormatArray[1].Margin.Left = 10;
        tocInfo.FormatArray[1].Margin.Right = 30;
        tocInfo.FormatArray[1].LineDash = TabLeaderType.None;
        tocInfo.FormatArray[1].TextState.FontSize = 10;
        tocInfo.FormatArray[2].Margin.Left = 20;
        tocInfo.FormatArray[2].Margin.Right = 30;
        tocInfo.FormatArray[3].LineDash = TabLeaderType.None;
        tocInfo.FormatArray[3].Margin.Left = 30;
        tocInfo.FormatArray[3].Margin.Right = 30;

        //Create a section in the Pdf document
        Page page = doc.Pages.Add();

        //Add four headings in the section
        for (int Level = 1; Level <= 4; Level++)

            Aspose.Pdf.Heading heading2 = new Aspose.Pdf.Heading(Level);
            TextSegment segment2 = new TextSegment();
            heading2.IsAutoSequence = true;
            heading2.TocPage = tocPage;
            segment2.Text = "Sample Heading" + Level;
            heading2.TextState.Font = FontRepository.FindFont("Verdana");

            //Add the heading into Table Of Contents.
            heading2.IsInList = true;

        // save the Pdf



We tested the scenario using the latest version of the API i.e. 22.4 and could not notice the issue that you have mentioned. Please check the attached PDF document that was created in our environment.
toc.pdf (35.5 KB)

Please note that we provide support on the basis of the latest version and if the issue is not happening in the latest version, it could not be addressed because issues in older versions of the API are resolved and fixed in the latest and higher versions. Please try to use the latest version and let us know in case you still notice any issues.