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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TextAlignment in header does not work with header.Graphics.DrawText?

Thread ID:





56758 Feb 20,2007 04:03 PM UTC Feb 21,2007 10:12 AM UTC WinForms 1
Tags: PDF
Asked On February 20, 2007 04:03 PM UTC

Hello Ma'am/Sir:

I have a datatable that would contain about 200-300 rows. When I print it to PDF, the pdf would contain 1+ pages (about 55 rows per page). I am tring to define a header that would have same columns (essentially name of the each col of the datatable) on all the pages. For the numeric data, I would like the alignment to be right aligned in the header. This does not seem to work. I get the data to be aligned right.

Can you pl help?

I am using v3.3 on .Net 1.1.



Administrator [Syncfusion]
Replied On February 21, 2007 10:12 AM UTC

Hi Jonam,

Thanks for your interest in Essential PDF.

You cannot set the text alignment of header by using header.Graphics.DrawText. It can be possible by using header.Graphics.DrawMultiText.

//Set the header Textalignment as right
props.TextAlignment = TextAlignment.Right;
Rectangle rect = new Rectangle( 0,0,(int)doc.LastPage.DrawingWidth-10,40);
header.Graphics.DrawMultiText( rect,title, font, props );

//Set the table header Textalignment as right
table.Header[0].Cells[i].Style.TextAlignment = TextAlignment.Right;

You can repeat the header for all pages by using RepeatHeader property

//For repeating the header to all pages

table.RepeatHeader = true;

Kindly try running the attached sample and let me know if you have any other queries.

Best Regards,



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon