We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Replacing string overlaps existing text

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.

Hi Diego,


Thanks
for using our products.
<o:p></o:p>

I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this issue as PDFNEWNET-35606 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFNEWNET-35606) have been fixed in Aspose.Pdf for .NET 9.7.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.