Hi, i am using aspose pdf to create an table of content for the provided pdf file.
For this i need to read headings or sub headings from each page. I have tried various methods including TextFragmentAbsorber as well but unable to get required results.
following is the code /w TextFragmentAbsorber
Document doc = new Document(sInputFilePath);
foreach (Page page in doc.Pages)
{
TextFragmentAbsorber absorber = new TextFragmentAbsorber();
page.Accept(absorber);
var _title = $“{absorber.TextFragments[2].Text} {absorber.TextFragments[3].Text}”;
tocTitles.Add(_title);
page.Dispose();
}
Here i am not able to identify whether fragment text is heading or subheading.
Shall anyone please let me know how can i extract/ read headings or subheadings from each pdf page?