How to Extract PDF Content with style

How to Extract PDF Content with style.

Is it possible to get extract content between two sections (Headers) Like TOC Contents in Doc.Test.pdf (191.8 KB)

@kranthireddyr,

You can iterate through the local links and retrieve the page number from action destination as follows:

[C#]

string dataDir = @"C:\Pdf\test578\";
// Load the PDF file
Document document = new Document(dataDir + "Test.pdf");
foreach (Aspose.Pdf.Annotations.Annotation annot in document.Pages[1].Annotations)
{
    if (annot is LinkAnnotation)
    {
        Console.WriteLine("Destination: " + ((annot as LinkAnnotation).Action as GoToAction).Destination);
    }
}

Finally, you can search and retrieve text from the target page number. Please refer to this help topic: Search and Get Text from Pages of a PDF Document

Hi Team,(Java)
I need to extract content from PDF document.
We converted a AutoCAD drawing (.dwg) file into PDF Document and trying to read the values.
I tried snippet of code shared in this thread, did not work.
Please share a code.
Our PDF documents contains table and content in it.It does not have any plain text.
All content are inside Table.
Document cannot be shared.
Please assist.

Regards,
Mamtha.A.C.D.

@HAREEM_HCL_COM

Before using above shared code snippet, please make sure that your PDF document (which is obtained after converting .dwg) contains text or annotations inside it. In case it contains only image(s), you need to extract text from images using OCR operation. You may extract images from PDF using Aspose.PDF for Java and later perform OCR on image using Aspose.OCR for Java.

In case you still face any issue please share your sample document with us. Please note that we need sample document to investigate the scenario and replicate issue in our environment. We assure you that we do not disclose your sample files with anyone and they are used only for testing purposes. As soon as the scenario investigation is completed, the files are removed from the system.

You may share file privately in a private message by clicking over username and press the blue ‘Message’ button.