【发布时间】:2014-07-10 11:32:42
【问题描述】:
我正在使用 MigraDoc 创建 PDF 文档。 我为所有页面添加了一个全尺寸的“标题”:
Image bg = section.Headers.FirstPage.AddImage(@"\\server\header.bmp");
bg.Height = "29.7cm";
bg.Width = "21cm";
bg.RelativeVertical = RelativeVertical.Page;
bg.RelativeHorizontal = RelativeHorizontal.Page;
bg.WrapFormat.Style = WrapStyle.Through;
现在我想将文本框中的文本添加到该页面:
Paragraph paragraph = section.AddParagraph();
paragraph.Format.SpaceBefore = "7.5cm";
paragraph.Format.SpaceAfter = "5";
paragraph.Format.Font.Color = Color.FromCmyk(100, 100, 100, 100);
FormattedText ft = paragraph.AddFormattedText(this.gMailItem.Body);
我遇到的问题是我添加的文本可能大于一页。如果发生这种情况,文本将打印在“全尺寸标题”/文具上。 有没有办法限制文档的高度(强制分页)?
编辑:这是我的问题的图片:http://img4host.net/upload/1014244953be8611defa9.PNG
【问题讨论】: