Hi there, thanks for your time looking into my request.
I am replacing text using Aspose.PDF but the horizontal alignment (center ) is not working. Am I doing anything wrong here or is there some issue with API. Please advise. Please see my code below:
public static void DoFindReplaceText(string find, Aspose.Pdf.Document pdfDocument, string replace)
{
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(find);
pdfDocument.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (TextFragment textFragment in textFragmentCollection)
{
textFragment.HorizontalAlignment = HorizontalAlignment.Center;
textFragment.Text = replace;
}
}
Best Regards
Rupesh