Problem update Text Layer


#1

Aspose.PSD.Net Version 19.5.0.0

“Can not locate global resource occurance of text”

bug.jpg (125.2 KB)


#2

@hunsup,

Can you please share source file which you used on your end so that we may further investigate to help you out.


#3
        //ExStart:UpdateTextLayerInPSDFile
        // The path to the documents directory.
        string dataDir = RunExamples.GetDataDir_PSD();

        // Load a PSD file as an image and cast it into PsdImage
        using (PsdImage psdImage = (PsdImage)Image.Load(dataDir + "layers.psd"))
        {
            foreach (var layer in psdImage.Layers)
            {
                if (layer is TextLayer)
                {
                    TextLayer textLayer = layer as TextLayer;
                    textLayer.UpdateText("test update", new Point(0, 0), 15.0f, Color.Purple);
                }
            }

            psdImage.Save(dataDir + "UpdateTextLayerInPSDFile_out.psd");
        }

Error in the sample code provided
textLayer.UpdateText(“test update”, new Point(0, 0), 15.0f, Color.Purple);

‘Aspose.PSD.CoreExceptions.ImageFormats.PsdImageException’
==> “Can not locate global resource occurance of text”


#4

@hunsup,

Can you please share source PSD file which you used on your end.


#5

layers.zip (403.9 KB)

It’s a layers.psd you’re offering sample.


#6

@hunsup,

I have worked with source files and have been able to observe issue. A ticket with ID PSDNET-161 has been created in our issue tracking system for further investigate and resolve. This thread has been associated with this ticket, so that you can be automatically notified as soon as this issue is resolved.