PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

To right justify a column of figures
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1813
Page 1 of 1

Author:  wayfarer [ Mon Oct 10, 2011 1:21 pm ]
Post subject:  To right justify a column of figures

Hi. How can I cause a column of figures to the justified right, not left? I presumably subtract the string width from its left position - how do I get the width of the string?

Eg:
gfx.DrawString(Label1.Text, font, XBrushes.Black, New XRect(150 - Unknown, 45, page.Width.Point, 0), XStringFormats.Default)

where Unknown is the string width.

Thank you.

Author:  Thomas Hoevel [ Mon Oct 10, 2011 3:11 pm ]
Post subject:  Re: To right justify a column of figures

Hi! How about gfx.MeasureString()?

Author:  wayfarer [ Mon Oct 10, 2011 4:37 pm ]
Post subject:  Re: To right justify a column of figures

Thank you.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/