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

Left justify in PDFSharp
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1199
Page 1 of 1

Author:  tmsw [ Thu May 27, 2010 8:48 pm ]
Post subject:  Left justify in PDFSharp

Is there a way to left justify text in PDFSharp without using MigraDoc? When trying to output text using DrawString, the text seems to be justifed across the rectangle that is passed to the DrawString method as a parameter.

Thanks for the help

Author:  Rob [ Wed Jun 02, 2010 5:13 am ]
Post subject:  Re: Left justify in PDFSharp

You need an XStringFormat (or one of the pre-defined settings in XStringFormats)

Code:
 
XStringFormat format = new XStringFormat();
format.Alignment = XStringAlignment.Near;
format.LineAlignment = XLineAlignment.Center;


which is passed as parameter to the .DrawString-function.

Best Regard
Rob.

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