Free Support Forum - aspose.com

Setting the text directionality

Hi,
is there any way to set the directionality of the text layer? E.g. in attached file, there are two boxes, one with Right to Left and one with Left to Right alignment, is there any way to set this property in the API?bidi.zip (22.8 KB)

@rlaskowski.sdl,

I have observed your requirements and regret to share that there seems to be an issue with API when working with RTL language. An issue with ID PSDNET-587 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once issue will be fixed.

The issues you have found earlier (filed as PSDNET-587) have been fixed in this update.

@rlaskowski.sdl,

Please try using following sample code on your end for setting the alignment of text in PSD.

            string sourceFileName = "bidi.psd";
            string outputFileName = "bidiOutput.psd";

            using (PsdImage image = (PsdImage)Image.Load(sourceFileName))
            {
                var layer = (TextLayer)image.Layers[2];
                var portions = layer.TextData.Items;

                portions[0].Paragraph.Justification = 2;
                layer.TextData.UpdateLayerData();

                image.Save(outputFileName);
            }