Aspose.Psd for .NET textLayer.UpdateText() is printing '-' (dash) as underscrore in random manner for different data set

Aspose Error underscore.jpg (7.1 KB)
Issue Detail :

  • On textLayer.UpdateText(), ‘-’ (dash) is printed as ‘_’ (underscrore) in random manner for different data set.

  • This is not case with Graphics.DrawString()

  • When long text contains multiple ‘-’ (dash) them some ‘-’ are printed as underscore. Not all.

@schoolplex I created an issue according to your report: PSDNET-1301: Aspose.Psd for .NET textLayer.UpdateText() is printing ‘-’ (dash) as underscrore in random manner for different data set

If it’s possible, could you please provide code sample and test files to reproduce this and to demonstrate the difference of data set you used.

TEST_PSD_FILE.7z (28.2 KB)

I am providing the code, test PSD file and the output image. Data Set is as provided in sample code.

using (PsdImage psdImage = (PsdImage)Image.Load("D:\\TE<a class="attachment" href="/uploads/default/68114">OUTPUTIMAGE.jpg</a> (36.3 KB)
                    foreach (var layer in psdImage.Layers.Where(x => x.IsVisible))
                        if (layer is TextLayer)
                            TextLayer textLayer = layer as TextLayer;
                            switch (layer.Name.Trim().ToUpper())
                                case "NAME":
                                    textLayer.UpdateText("MR. JACK SMITH");
                                case "IDNO":
                                    textLayer.UpdateText("OFF-022/GRP - 016");
                                case "DESIGNATION":
                                case "BLOODGROUP":
                                case "ADDRESS":
                                    textLayer.UpdateText("BLOCK-A, STREET-7, APPT NO - 047, SECTOR-024");
                                case "PERMADDRESS":
                                    textLayer.UpdateText("HOUSE NO - 42, LANE -025, PALM GREENS VIEW HOUSING SOCIETY, SECTOR - 45");
                    string previewImagepath = "D:\\OUTPUTIMAGE.jpg";

If you need anything else , kindly let me know.

@schoolplex thank you. I’ve updated PSDNET-1301. I’ll text you back after the PSD Team investigate this issue.

1 Like

Hi ,
Is there any update on this issue.
If you add any text with hyphen like 2022-23, it will it will be shown as 2022_23 while exporting as image file with .Net library.
Its a bug and can not use psd library as it corrupts data.
Need solution in priority.

@schoolplex This task is scheduled for Feb 2023.
You will be notified when it is fixed.
In addition, we are currently working on other improvements to text rendering, and checking shows that your issue may be resolved with this improvement.

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