TextBound is not working as expected

TextBound of a text layer does not work as in the previous version of 23.6. The height and width are set, then an updatetext, where you can see that they have the new values ​​but the final result is that the textbound is not affected.
Code explain:
What I am doing is replacing the text of a textlayer according to the content loaded in a text file that is taken as input parameter to the program. Take into account that the text box of the text layer is large to adjust it later. After replacing the text, the textlayer is centered to the left, in this process I obtain the height of words and I set the same height to the textbound. The textlayer box would have to have the same height as the words, and in this case it will be located in the upper left, and with the width and height modified
Input psd:
input_Test_forTicket.zip (1.5 MB)
Input txt:
input-text (2).zip (155 Bytes)
Code:
Code-forTicket.zip (1.1 KB)

@cristianortegaethofy
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-1608

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you for anwserme. I tried with others psd and they have the same problem with the last version (23.6), it can be confirmed that the method TextLayer.TextBoundBox { get; set; } doesn’t work ? Is there any workaround?

@cristianortegaethofy I can suggest a workaround after the investigation of this issue. The task is planned to the next week until it not investigated, please try to use previous version of Aspose.PSD.

@cristianortegaethofy please check this temporary workaround. It works on the developers’ workstations.

  // Set the RectangleF.Empty to TextBoundBox before the real value.
  textLayer.TextBoundBox = RectangleF.Empty;
  textLayer.TextBoundBox = new Aspose.PSD.RectangleF(PointF.Empty, newTextBox);

This bug will be fixed in 23.7.

1 Like

Thank you, I have tried the workaround and it works correctly

1 Like

The issues you have found earlier (filed as PSDNET-1608) have been fixed in this update. This message was posted using Bugs notification tool by yaroslav.lisovskyi