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

Free Support Forum - aspose.com

How to properly left-align text with DrawString method?

Hello Team,

We are using Aspose.imaging version 21.4.0 in our application. In that, we are drawing two text using drawstring method having different font size. When we check generated output it’s look like both the text is not left aligned properly. How can we resolve this issue? For reference, we have attached sample application and generated output. Please suggest.

SampleApp.zip (5.0 MB)

@siriussynoptek

We are sorry for your inconvenience. We are working over the requirements and will share the feedback with you as soon as possible.

@siriussynoptek
Please, find current workaround solution of left alignment issue in the attachment.

RenderHTML.zip (28.0 KB)

Hello Team,

I have checked attached solution but still look like both text(“This”) is not exact left aligned. I have attached generated output image. Can you please suggest here?

output.png (5.3 KB)

@siriussynoptek
Thank you for coming back. You’re right - the proposed workaround solution does not allow the achievement of pixel-perfect alignment results. We believe that may achieve better results (Output.ToBe.png (8.2 KB)) and created the internal issue IMAGINGNET-4923 to process within next product releases, you’ll be notified on progress.