Text Orientation Support

Text Orientation Support

Forum member · Jul 18, 2011
I am interested and testing your DynamicPDF functionality and I want to know if your library supports the TextOrientation feature? I need the column headers of the table to be oriented vertically (rotated 90 degrees). Is it possible? If yes, can you show me some sample code for the same? Thanks, Rohit A.

Re: Text Orientation Support

Support · Jul 18, 2011
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.

Re: Text Orientation Support

Forum member · Jul 19, 2011
Thank you so much. This solved my concern. Rohit A.