I use Aspose.PDF to combine multiple PDF’s and generate TOC to point to each page. This works in most of the cases, but in some specific case when TOC is not fitting in to page, it fails to generate the TOC in combined file.
In my observation, if I adjust the margin in TextFragment it works fine, but some other cases it fails.
See the attached code
var tocInfo = new TocInfo
{
Title = new TextFragment(TableOfContentsTitle)
{
TextState =
{
FontSize = TableOfContentsFontSize,
FontStyle = TableOfContentsFontStyle
},
Margin = new MarginInfo(0, 10, 0, 0),
}
};
I feel something wrong with generation of PDF that it is failing to generate PDF content when the TOC can’t be fit in to single page.
Thanks