Replace text layer effect is lost

5.zip (4.0 MB)

@jack825 Could you please provide the code you used.

TextLayer textLayer = (TextLayer)psdtxtlayer;
//var w = textLayer.Width;
//var h = textLayer.Height;
var lname = textLayer.Name;
var txt = item.Value.ToArray();
for (int kk = 0; kk < textLayer.TextData.Items.Length; kk++)
{
textLayer.TextData.Items[kk].Text = txt[kk].ToString().Replace("\r", “\v”);
}
textLayer.TextData.UpdateLayerData();
textLayer.Name = lname;

@jack825 thank you for the provided code, but I can’t see the code that you use to open the file. It can be important.

The correct way to open the file with effects is

using (PsdImage image = (PsdImage)Image.Load(inputFilePath, new PsdLoadOptions() { LoadEffectsResource = true, UseDiskForLoadEffectsResource = true })) {}

Could you please clarify how did you open the file.

var loadOptions = new PsdLoadOptions()
{
ReadOnlyMode = false,
LoadEffectsResource = true,
};
var psdImage = (PsdImage)Aspose.PSD.Image.Load(openfilename, loadOptions);

psdImage.Save(filename, new PsdOptions() { CompressionMethod = CompressionMethod.ZipWithPrediction, ColorMode = ColorModes.Rgb });

Tips Image saving failed

@jack825 What do you mean under the “Replace text layer effect is lost”. I can not confirm that effect is lost. Your file has 2 text layers. One horizontal with effects and one vertical without effects. Aspose.PSD at this moment doesn’t support vertical text, but we have this task in our backlog and will implement it soon. So, I can confirm that vertical text alignment lost after saving,if it’s your issue, I can send you issue id in our backlog to give you ability to track this task.