I’m using Aspose.Imaging.18.4.0 to process *.psd files using the following code:
private void UpdateText(string filePath, string newText)
{
using (var image = Image.Load(filePath))
{
if (!(image is PsdImage)) return;
var psdImage = (PsdImage)image;
var layers = psdImage.Layers;
for (var index = layers.Length - 1; index >= 0; index--)
{
var layer = layers[index];
if (!(layer is TextLayer)) continue;
var textLayer = (TextLayer)layer;
textLayer.UpdateText(newText);
}
var imageOptions = new PsdOptions(psdImage);
var fileName = Path.GetFileName(filePath);
var outputFilePath = Path.GetDirectoryName(filePath) + "\\target_" + fileName;
psdImage.Save(outputFilePath, imageOptions);
}
}
The source file is here: https:// drive.google.com/open?id=1-XIGf2AYHqmPlGitFLqEnDcYxZtMH1PJ
If I used this file, which the text is written in Arabic language, the method UpdateText() throw an exception. and didn’t update the text