Hello
When I update the text on a TextLayer using update_text()
, all the FX (layer effects) applied to the layer are removed. After exporting the file to PNG, the updated text appears plain, without any of the original effects.
image.png (1,6 Ko)
Code :
from aspose.psd import Image
from aspose.psd.fileformats.psd import PsdImage
from aspose.psd.fileformats.psd.layers import TextLayer
from aspose.pycore import cast
from aspose.psd.imageoptions import PngOptions
from aspose.psd.fileformats.png import PngColorType
# Load a PSD file
with Image.load("example.psd") as image:
psd = cast(PsdImage, image)
# Find the first TextLayer and update its text
for layer in psd.layers:
if isinstance(layer, TextLayer):
print(f"Original Text: {layer.text}")
# Update the text
layer.update_text("New Text")
print(f"Updated Text: {layer.text}")
# Export to PNG
png_options = PngOptions()
png_options.color_type = PngColorType.TRUECOLOR_WITH_ALPHA
psd.save("output.png", png_options)
break
After running this, the exported output.png
shows the updated text without any of the FX that were originally applied. Is this expected behavior, or am I missing a step to preserve the layer effects?
Thanks!