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

Free Support Forum - aspose.com

Text Replacing - Stacked Letters

Hi,

I have a text based PDF and I am trying to replace a word such as "aaa" with a longer word, for instance "eeeeeeeee". Doing this, the longer text goes over the next word (letters are stacked) although the expected behaviour would be the next word to shift to right.

I know that PDF is not that easy to shift text like this; but I hope you guys have a suggestion for handling this kind of replacement.

PS: The issue does not occur if all words do have the exact same format; but if even a little formatting difference exist, than the problem shows up.

Attached is a screenshot of the problem we are having.

Please advise.

Thanks.

Hi Alp,


Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 7.7.0 while using one of my sample PDF file and I am unable to notice any issue. After the string is replaced, the next string is being moved to right. Can you please share the source/sample file so that we can test the scenario at our end. We are sorry for this inconvenience.

Hi,

I am also using version 7.7.

Attached is the input file I use for this test case and below is the code to replace:

Aspose.Pdf.Text.TextFragmentAbsorber textFragmentAbsorber = new Aspose.Pdf.Text.TextFragmentAbsorber("˗˗˗˗˗˗");
aspose_pdf.Pages.Accept(textFragmentAbsorber);
Aspose.Pdf.Text.TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (Aspose.Pdf.Text.TextFragment textFragment in textFragmentCollection)
{
textFragment.Text = "443211789";
}

textFragmentAbsorber = new Aspose.Pdf.Text.TextFragmentAbsorber("˗˗˗˗˗");
aspose_pdf.Pages.Accept(textFragmentAbsorber);
textFragmentCollection = textFragmentAbsorber.TextFragments;
foreach (Aspose.Pdf.Text.TextFragment textFragment in textFragmentCollection)
{
textFragment.Text = "11/03/2013";
}

Thanks.

Hi,


Thanks for sharing the resource file.

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-34987 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.<o:p></o:p>

Can you please provide information about the status on this issue?

Hi Alp,


Thanks for your inquiry. Your reported issue is not resolved and I’m afraid we can’t share any ETA at the moment. As we have recently noticed the issue and logged in our issue tracking system. Its pending in queue for analysis. Once our development team completes the analysis then we would be in position to share some ETA with you.

Thanks for you patience and cooperation.

Best Regards,

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


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

Hi Alp,


Thanks for your patience. In reference to above stated fix of PDFNEWNET-34987, we have improved some features in text replacement and now text fragments being adjusted automatically after replacement. Please download and try latest release of Aspose.Pdf for .NET, it will help you to resolve the issue.


Please feel free to contact us for any further assistance.


Best Regards,