I’m having a problem where my document has a textbox with the text alignment set to justify.
I then run a process where I replace some text
Aspose.Pdf.Facades.PdfContentEditor pdfContentEditor = new Aspose.Pdf.Facades.PdfContentEditor();
pdfContentEditor.BindPdf(profileDocument);
pdfContentEditor.ReplaceTextStrategy.ReplaceScope = Aspose.Pdf.Facades.ReplaceTextStrategy.Scope.REPLACE_ALL;
//replace text on all pages
pdfContentEditor.ReplaceText(“FirstName”, firstName);
pdfContentEditor.Save(userProfilePath);
The resulting output has replaced the text but now the text is left justified.
What I really want to accomplish here is just the text replacement (which works fine) but I want it to leave the existing formatting and alignment alone.
I’ve attached the document I’m using and you can see the issue on page 6. Notice the text is set to “Justify” and aligns both left and right when you open the document but after doing the text replacement the paragraphs under “Golf Temperament” are now left aligned.
I appreciate the response and confirmation of the problem but I’ve dug through the forums and noticed someone else pointed out this issue in November of last year and ticket PDFREP-33479 was created but no updates to the thread have been posted. I am not going to be able to delay the business need for > 4 months on this issue. Is there any work around I can use or an update to the previous ticket that might resolve this issue?
Hi Brad,
Thanks for sharing the details.
The issue PDFREP-33479 is related to Aspose.Pdf for Reporting Services, which is a rendering extension for SQL Reporting Services and this problem is related to Textbox with Justify not working when text contains a parameter. Please note that Aspose.Pdf for .NET and Aspose.Pdf for Reporting Services are separate components and your problem is related to Aspose.Pdf for .NET.
Util or unless we have evaluated the issue in details, I am afraid we might not be able to share any workaround for this problem. However as soon as we have some definite progress towards its resolution, we will let you know.
The issues you have found earlier (filed as PDFNET-38440) have been fixed in Aspose.PDF for .NET 22.6.