Get Page Number and position of text in pdf using Aspose.Pdf .Net

I have the below similar requirement.

I want to add a signature field based on the position of the text and page number. How can I achieve that? Please help.

@kooldoode

You can get position and page number of text with this code.

// Open document
Document pdfDocument = new Document(dataDir + "ExtractTextPage.pdf");

TextFragmentAbsorber tfa = new TextFragmentAbsorber();
pdfDocument.Pages.Accept(tfa);
TextFragmentCollection tfc = tfa.TextFragments;
foreach (TextFragment tf in tfc)
{
    Console.WriteLine(tf.Rectangle);
    Console.WriteLine(tf.Page.Number);
}

Then I suggest you to visit this article: Securing and signing PDF documents for adding signature.

Thanks @mudassir.fayyaz. It works now.