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.
Unfortunately, activation email could not send to your email. Please try again.

PdfLightTable Cell text alignment

Thread ID:

Created:

Updated:

Platform:

Replies:

71627 Feb 7,2008 01:18 PM Feb 11,2008 01:07 AM ASP.NET Web Forms (Classic) 1
loading
Tags: PDF
Jeff
Asked On February 7, 2008 01:18 PM

I'm trying to put a header on my PDF pages that has the title on the left and the current date on the right. I can't seem to figure it out. I tried using the PdfTextElement but I can't seem to draw that to the PdfPageTemplateElement and give it a PdfStringFormat with a RightAlignment.

So I next tried to do a PdfLightTable by building up a DataTable for those two items. But I can't figure out how to do an alignment within a table cell.

Also, with your older versions I think I remember being able to build up a table programmatically which gave me much more control over each cell because I could give each one a CellStyle. Is there a way to do tables this way in version 6.1?


Yavanaarasi G [Syncfusion]
Replied On February 11, 2008 01:07 AM

Hi Jeff,

Sorry for the delay in responding.

1.How to do an alignment within a table cell?

You can use the following code snippet for alignment within a table cell:


[C#]
PdfStringFormat sf2 = new PdfStringFormat(PdfTextAlignment.Right);
PdfStringFormat sf1 = new PdfStringFormat(PdfTextAlignment.Left);


2.I could give each one a CellStyle. Is there a way to do tables this way in version 6.1?

Yes.It is possible in our new PDF. You can Use below code snippet for setting cellstyle:

[c#]
PdfCellStyle altStyle = new PdfCellStyle();
altStyle.Font =font;
altStyle.BackgroundBrush = brush;
altStyle.BorderPen = borderPen;
altStyle.StringFormat = sf2;


Please refer the sample in the below link which illustrates the above:

http://websamples.syncfusion.com//samples/PDF.Windows/F-71627/main.htm

Here is the documentation link for table features and formatting the table in new PDF:

http://www2.syncfusion.com/ug_latest/pdf/Tables.html

Please try running the above sample and let me know if this helps.

Regards,
G.Yavana



CONFIRMATION

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.

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.

;