Update Text In Text Layer Inside PSD File

Updating Text In Text Layer Inside PSD File

The following sample code loads a PSD file, access the text layer, update the text and save the PSD file with a new name using com.aspose.imaging.fileformats.psd.Layers.TextLayer.UpdateText method.

Additional Options

Some times while updating text in text layer may damage file and you may not be able to view the updated result. To avoid/correct such behavior Aspose.Imaging has introduced some additional options.

  • Method setRemoveGlobalTextEngineResource has been introduced. The purpose of this method is to inform that global text resources must be removed. By default its value is FALSE. You may call this method and pass TRUE to remove global text resources.
  • Method setRefreshImagePreviewData has been introduced. The purpose of this method is to render final image data section. This will make PSD file compatible with image viewing tools that uses only Image data section. By default its value is TRUE.

Following is the sample code demonstrating how to call setRemoveGlobalTextEngineResource method.