我在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 };
}