Posted by a ceTe Software moderator
Hello Rohit,
Yes, you can achieve your requirements by using Table2 page element of our DynamicPDF Generator for .NET API. You will need to add TextArea or Label page element and align the text accordingly and you can rotate the text vertically using Angle property of the page elements. You will have to add this page element to the cell of the Table page element. Below is the sample code for it.
Document document = new ceTe.DynamicPDF.Document();
Page page = new ceTe.DynamicPDF.Page(PageSize.A4, 30f);
Table2 table = new Table2(100, 100, 300, 600);
Column2 column1 = table.Columns.Add(100);
TextArea area1 = new TextArea("Column1", 30, 20, 100, 20);
area1.TextColor = RgbColor.Blue;
area1.Align = TextAlign.Left;
area1.Angle = -90;
Font font = Font.Helvetica;
float textwidth = font.GetTextWidth("Column1", 12);
area1.Y = textwidth-4;
Row2 row = table.Rows.Add();
Cell2 cell1=row.Cells.Add(area1);
row.Height = textwidth;
for (int index = 0; index < 3; index++)
{
row = table.Rows.Add();
row.Cells.Add("Test1");
}
page.Elements.Add(table);
document.Pages.Add(page);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team.