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

Free Support Forum - aspose.com

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)
OUTPUTIMAGE.jpg (36.3 KB)
Hi,

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/discourse_instance3/68114">OUTPUTIMAGE.jpg</a> (36.3 KB)
 ST_PSD_FILE.PSD"))
                {
                    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");
                                    break;
                                case "IDNO":
                                    textLayer.UpdateText("OFF-022/GRP - 016");
                                    break;
                                case "DESIGNATION":
                                    textLayer.UpdateText("OFFICER-001");
                                    break;
                                case "BLOODGROUP":
                                    textLayer.UpdateText("AB-");
                                    break;
                                case "ADDRESS":
                                    textLayer.UpdateText("BLOCK-A, STREET-7, APPT NO - 047, SECTOR-024");
                                    break;
                                case "PERMADDRESS":
                                    textLayer.UpdateText("HOUSE NO - 42, LANE -025, PALM GREENS VIEW HOUSING SOCIETY, SECTOR - 45");
                                    break;
                            }
                        }
                    }
                    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