Free Support Forum - aspose.com

Get font style bold italic while extracting text from PDF using Aspose.PDF for .NET

While reading text from paragraphs using Aspose PDF, I am unable to identify Bold and italic text and also unable to read bullet points. Can someone help me how to achieve this using Aspose PDF?

@kiraninstancy

Would you kindly share your sample PDF document with us. We will test the scenario in our environment and address it accordingly. Also, please share in which platform you are working e.g. .NET/Java.

@asad.ali
Thanks for your reply.
I am using Aspose PDF for .NET.
Please find a sample PDF document that I am using. Problem is not only with this PDF document
ASP.NET - WebServices1.pdf (1.2 MB)

@kiraninstancy

We have tested the scenario using following code snippet and Aspose.PDF for .NET 20.2. We noticed that font style was always extracted as regular by the API.

var textFragmentAbsorber = new TextFragmentAbsorber("ASP.NET");
var textSearchOptions = new TextSearchOptions(false);
textFragmentAbsorber.TextSearchOptions = textSearchOptions;
Document pdfDocument = new Document(dataDir + "ASP.NET - WebServices1.pdf");
pdfDocument.Pages.Accept(textFragmentAbsorber);
var textFragmentCollection = textFragmentAbsorber.TextFragments;
var style = textFragmentAbsorber.TextFragments[1].TextState.FontStyle; // Its always regular

We have also logged a feature request as PDFNET-47689 in our issue tracking system for the sake of implementation of required feature. We will further check the feasibility of the support and keep you posted with the status of its availability. Please be patient and spare us little time.

We are sorry for the inconvenience.

@asad.ali
Greetings for the day and thanks for your reply.

As i mentioned earlier I am already getting font style. The problem with bold and italic text formats, also not supporting order list and un order list formats.
Please let me know if any solution is there.

Thanks,
Kiran.

@kiraninstancy

Yes, we have also noticed same issue and logged this in our issue management system under the ticket ID which was shared earlier. We will surely inform you as soon as it is resolved.