PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jun 27, 2024 7:49 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Left justify in PDFSharp
PostPosted: Thu May 27, 2010 8:48 pm 
Offline

Joined: Thu May 27, 2010 8:43 pm
Posts: 1
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 02, 2010 5:13 am 
Offline

Joined: Mon Feb 01, 2010 10:32 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group