textabcpdfabcpdf9

Align text to the right using AbcPdf 9


I am using abcpdf 9.

Is there a way to align text to the right.

At the moment I have the following

theDoc.Rect.Width = 100;
theDoc.Rect.Height = 21;
theDoc.Rect.Position(490, 808);
theDoc.FontSize = 10;
theDoc.AddText($"Some text");

This will put the box in the correct place, but the text is left aligned and I need it right.


Solution

  • try

    theDoc.TextStyle.HPos = 1.0;
    

    See http://www.websupergoo.com/helppdfnet/source/5-abcpdf/xtextstyle/2-properties/hpos.htm for reference.