【发布时间】:2016-11-02 13:44:51
【问题描述】:
我在 TextFrame 中使用 Paragraph 来让文本方向向上显示,这几乎是我想要的,我遇到的最后一个问题是文本似乎是左对齐的,我试过了将段落对齐设置为居中这没有任何影响,并且看不到使用 TextFrame 执行此操作的选项。每次输出的文本都不一样。
这是我目前拥有的
这就是我想要实现的目标
以下是我使用 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°?!