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

question about XStringFormats
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1383
Page 1 of 1

Author:  webdvlp [ Wed Oct 20, 2010 4:38 pm ]
Post subject:  question about XStringFormats

i have such code
Code:
gfx.DrawString("Page "+number.ToString(), font, XBrushes.Firebrick,
              new XRect(new XPoint(), gfx.PageSize), XStringFormats.BottomCenter);


i want to draw page number in bottom right corner, but i don't see such parameter in XStringFormats, how can i solve it?

Author:  Thomas Hoevel [ Thu Oct 21, 2010 7:27 am ]
Post subject:  Re: question about XStringFormats

You are not limited to the pre-defined combinations.
You should be able to use your own BottomRight:
Code:
public static XStringFormat BottomRight
{
  get
  {
    XStringFormat format = new XStringFormat();
    format.Alignment = XStringAlignment.Far;
    format.LineAlignment = XLineAlignment.Far;
    return format;
  }
}


Or just use the inner code:
Code:
    XStringFormat format = new XStringFormat();
    format.Alignment = XStringAlignment.Far;
    format.LineAlignment = XLineAlignment.Far;

Author:  webdvlp [ Thu Oct 21, 2010 7:42 am ]
Post subject:  Re: question about XStringFormats

thx

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