We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Text Alignment

I want to align some text. The following is the code that I can''t seem to get it to work: IPDFGraphicState pdfAlign = pdfDoc.Graphics.CreateGraphicState(); pdfAlign.TextAlignment = TextAlignment.Center; firstPage.Graphics.DrawText(new Point(0,10),"LWDA No.",pdfFontHeader,pdfAlign);

1 Reply

AD Administrator Syncfusion Team February 24, 2005 12:19 PM UTC

Hi Donovan, Currently Text Alignment only works on Text inside a Rectange, Table cell etc. Please try this IPDFGraphicState pdfAlign = pdfDoc.Graphics.CreateGraphicState(); pdfAlign.TextAlignment = TextAlignment.Center; firstPage.Graphics.DrawMultiText(new RectangleF(0,10,300,100),"LWDA No.",pdfFontHeader,pdfAlign); Currently there is no support for complex layout structures like Sentence, Paragraphs etc, so there is no proper support for Text Alignment, However we will be implementing those structures shortly and they would have options for text alignment. Please let me know if you have any questions. Thanks, Stephen. >I want to align some text. The following is the code that I can''t seem to get it to work: > >IPDFGraphicState pdfAlign = pdfDoc.Graphics.CreateGraphicState(); > >pdfAlign.TextAlignment = TextAlignment.Center; > >firstPage.Graphics.DrawText(new Point(0,10),"LWDA No.",pdfFontHeader,pdfAlign); >

Loader.
Live Chat Icon For mobile
Up arrow icon