我正在使用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°?! –