We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save textLayer as image

hello,
I tried to export text layer to image file.
First, I tried to use textlayer.save() method.
image.png (6.9 KB)
(https://reference.aspose.com/psd/java/com.aspose.psd.fileformats.psd.layers/Layer#save-java.lang.String-com.aspose.psd.ImageOptionsBase-com.aspose.psd.Rectangle-)
But the results of image are different with machines.
Both of their machines doesn’t have that specific fonts.
In some machines, the fonts are maintained,
image.png (11.7 KB)

but in other machines, fonts are changed to default and save as that font.
image.png (10.7 KB)

After that, I thought that if save method is implemented different by the machine. So I also tried to not use your save method.
I extracted buffered image from your toBitmap(), and save it using Image.IO library from rt.java/javax.
But sadly, same situation was occurred.

So, now I want to know those things.

  1. Is the save() method or toBitmap() method works differently by the machine?
  2. If then, what factor affects for that results?

I look forward to hearing from you.

Hello,

Different machines can have different default system font, so this is behavior is expected.

You can use DefaultReplacementFont property to configure this behavior: https://reference.aspose.com/psd/net/aspose.psd/imageoptionsbase/properties/defaultreplacementfont

Please find the example of this property using on the API reference page.

Thank you.