Removing page numbers from PDF

Thanks @alexey.noskov , Your help is appreciated.

I am facing issue while remove page no from PDF , I have attach PDF & code is as below ,

Page no format is like X / X

Can you please help on this ?
OrgionalPDF.pdf (24.2 KB)

public Aspose.Pdf.Document RemovePageNumbersFromPdfDocument(Aspose.Pdf.Document pdfDocument)
{
    string regex = @"\d+\s*/\s*\d+";

    for (int pageNum = 1; pageNum <= pdfDocument.Pages.Count; pageNum++)
    {
        // Create TextFragmentAbsorber with the regex
        TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(regex);
        pdfDocument.Pages[pageNum].Accept(textFragmentAbsorber);

        // Remove detected page numbers
        foreach (TextFragment fragment in textFragmentAbsorber.TextFragments)
        {
            fragment.Text = "";  // Clear text
        }
    }
    foreach (var page in pdfDocument.Pages)
    {
        TextFragmentAbsorber absorber = new TextFragmentAbsorber(@"\d+\s*/\s*\d+");
        page.Accept(absorber);

        foreach (TextFragment fragment in absorber.TextFragments)
        {
            // Remove only if the text is near the bottom of the page
            if (fragment.Position.YIndent < 50)
            {
                fragment.Text = "";
            }
        }
    }

    return pdfDocument;
}

@avinashchilke1

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-59370

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.