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

Free Support Forum - aspose.com

TOC Wrapping issue


I have a issue in TOC, when the content of heading is large, it will truncate the data and show few of the last words only in second line after wrapping. Screenshot is attached here with. I am working on ASPOSE.PDF

Please help.




Please share the code snippet that you are using, so that we can test the issue at our end. We apologize for your inconvenience.

code for adding Heading is:

string _text="Insurance Marketing: Insurance Company & Agency Contacts";

Heading _heading = new Heading(document, pageSec, 1);
Segment hSegmentTbl = new Segment( _text);
_heading.LabelWidth = 5;
_heading.HeadingType = HeadingType.EnglishLower;
_heading.LabelPattern = "%)";
_heading.IsPrefixed = false; //Not Working - dont know
_heading.IsInList = true;
_heading.IsAutoSequence = true;
_heading.Margin.Top = 15;
_heading.Margin.Bottom = 15;

But the margin of the TOC page is:

lofSection.PageInfo.Margin.Right = 205;
lofSection.PageInfo.Margin.Left = 35;


I've tested the scenario using the code snippet that you have shared and I am unable to reproduce the issue. In fact what I've noticed from the image file is that you are also specifying some TextInfo, because my resultant PDF contains plain text. The file is in attachment.

Is it possible that you can share the complete project ?

Is it possible for you to reduce the right margin for lofSection ?

lofSection.ListFormatArray[0].TextInfo.FontName = "HelveticaNeue LT 75 Bold";
lofSection.ListFormatArray[0].TextInfo.FontSize = 11;
lofSection.ListFormatArray[0].TextInfo.Color = new Aspose.Pdf.Color(79, 87, 129);
lofSection.ListFormatArray[0].Margin.Top = 10;
lofSection.ListFormatArray[1].TextInfo.FontName = "HelveticaNeue LT 75 Bold";
lofSection.ListFormatArray[1].TextInfo.FontSize = 9;
lofSection.ListFormatArray[1].TextInfo.Color = new Aspose.Pdf.Color(79, 87, 129);
lofSection.ListFormatArray[1].Margin.Top = 8;

Above are the textInfor for the TOC, and its not possible to reduce the margin for me, and its also possible that user will enter more longer heading than this.


Today I downloaded and used new dll of aspose, so now the missing text is comming, but the alignment for the second line is still wrong, it should be alinged with first line of heading.

and I wonder why its happening, if you see in the attachment at right side, all page numbers are not properly aligned for level 1 and 2.



I have tested the issue and I’m able to reproduce the problem that alignment of second line & page numbers in TOC are not properly aligned. I have logged it in our issue tracking system as PDFNET-8237. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.


I'm pleased to inform you that the issue reported earlier is resolved in attached hotfix. Please try using it and in case you still face any issue or you've any further query, please feel free to contact.

The issues you have found earlier (filed as 8237) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.