Hi,
We are having some issues replacing text using the document that’s attached.
It ({User.Email}) is replaced correctly but it overlaps the rest of the text that’s after it.
This can be seen at the bottom of the first page.
Below is some sample code I used to reproduce the issue:
Document doc = new Document(“path_to_file”);
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("{User.Email}");
doc.Pages.Accept(textFragmentAbsorber);
foreach (TextFragment textFragment in textFragmentAbsorber.TextFragments){
textFragment.Text = "mymail@mydomain.com";
}
textFragmentAbsorber = new TextFragmentAbsorber("{User.Phone}");
doc.Pages.Accept(textFragmentAbsorber);
foreach (TextFragment textFragment in textFragmentAbsorber.TextFragments){
textFragment.Text = “123-456-789”;
}
doc.Save(“path_to_updated_file”);
Also, notice that the font type changes to Times New Roman but I have created a separate thread for that.
Is there something wrong with the document that seems to be confusing Aspose?
Thanks,
Diego.