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

Free Support Forum - aspose.com

How to get Heading content and table head row

Dear Team,

I am using Aspose.PDF api to analyse pdf file content, and I met two issues can’t find solution until now;

1.How to get heading content:
I found there are APIs to create heading, but did not find API how to get exist heading content, can you show me some light?
2. How to get table head row:
You know, in office word, if I insert one table, I can define the first row as header row, so does Aspose.PDF have api to check if this table has header row.

Many thanks for your advice

Brooke

@BrookeLi,

There are TableAbsorber, TextFragmentAbsorber, and ImagePlacementAbsorber classes, which help to find the elements from a PDF document, and works for content in the header and footer. Please refer to these help topics: Manipulate and Integrate Table, Search and Get Text from Pages of a PDF Document, Working with Image Placement.

@imran.rafique,
Imran, thanks for you response! My requirement is to get the heading content, not header and footer, I found this API as below:
Aspose.Pdf.Heading heading = new Aspose.Pdf.Heading(1);
But, I didn’t find any API which can get existing heading object and get the heading content, do you know about this?
For table, my requirement is to get the head row, which define the table column name, if I use TableAbsorber, I can get every row’s value, but I can’t check if the first row is head row or just data row.

Looking forward to your reply.

Brooke

@BrookeLi,

A feature request to retrieve headings from the PDF document has already been logged under the ticket ID PDFNET-35058 in our issue tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

After retrieving a table row, you can iterate through the text elements of each cell and find the font of text. If the font is bold, then you can determine that it is the heading row. The TextFragment instance, helps to retrieve the font of text. Please refer to this help topic: Replace fonts in existing PDF file

Hi Imran,

Thank you so much for your reply and advice. I will test it.

BTW, can I track this ticket, or how do I know the updates solves this feature in time?

Best Regards

@BrookeLi,

We will notify you once the linked ticket ID PDFNET-35058 is resolved. You can also ask for the status by posting a query in this thread.

hi has the issue been resolved? I’m also looking to read pdf content based on heading and would like to know about the status

@neha392

Thank you for getting back to us.

We are afraid that the feature request PDFNET-35058 has not been supported yet so headings may not be differentiated for now. We have logged your concerns and will let you know as soon as some significant updates will be available.