我正在使用TextFrame中的段落來獲取文本方向,以便向上顯示,這正在努力使我近乎如何我最終的問題是文本似乎是左對齊,我已經嘗試將段落對齊設置爲居中,這沒有任何影響,並且看不到使用TextFrame執行此操作的選項。輸出的文本每次都不一樣。MigraDoc/PDFSharp TextFrame中心對齊
這是我目前有
這是我想acheive
以下是我使用的達致這使用MigraDoc代碼
for (int i = 0; i < section2Items.Length; i++)
{
TextFrame colXTextFrame = bothSection2ItemHeadersRow.Cells[i + 1].AddTextFrame();
colXTextFrame.Orientation = TextOrientation.Upward;
colXTextFrame.Height = new Unit(140);
Paragraph colXParagraph = new Paragraph();
colXParagraph.Format.Alignment = ParagraphAlignment.Center;
colXParagraph.AddText(section2Items[i].Section2ItemTitle);
colXTextFrame.Add(colXParagraph);
bothSection2ItemHeadersRow.Cells[i + 1].Borders.Bottom = new Border() { Color = new MigraDoc.DocumentObjectModel.Color(255, 255, 255), Width = new MigraDoc.DocumentObjectModel.Unit(0), Style = MigraDoc.DocumentObjectModel.BorderStyle.None };
}
你可以發佈一些代碼?你使用哪種語言?你是否嘗試過垂直對齊而不是水平對齊,因爲你把它轉過90°?! –