I have an existing PDF document that I am trying to use a TextFragmentAbsorber to do a Find and Replace. I am able to find the fragment and I can see that the font name is currently "Gotham HTF Book,Italic". However, as soon as I change .Text to a different string, the font name changes to "TimesNewRoman". I want it to retain the original font. This also seems to cause an error when opening the PDF, but really I just need the font to remain the same and I believe that will address the error as well.
Any ideas? The relevant code fragment is below. Thanks!
int pageNum = 0;
foreach (Aspose.Pdf.Page pdfPage in sectionPdf.Pages)
{
TextFragmentAbsorber tfAbsorber = new TextFragmentAbsorber("PAGENUM");
pdfPage.Accept(tfAbsorber);
foreach (TextFragment fragment in tfAbsorber.TextFragments)
{
fragment.Text = pageNum.ToString();
}
pageNum++;
}