【发布时间】:2015-03-03 06:23:48
【问题描述】:
我正在尝试使用 abcpdf 创建一个结构,假设如下:
标题 内容 页脚
P.S:内容需要在页眉和页脚的“前面”
换句话说,我需要让我的内容从 y = 0 到 y = 100%;我的标题从 y = 0 到 y = 200;我的页脚从 y = 700 到 y = 100%。 (此处的值只是示例)
我希望我是清楚的。
目前我有这些方法:
private void CreateDocHeader(Doc theDoc, int theCount, string content)
{
theDoc.Rect.String = "0 660 600 825";
theDoc.MediaBox.String = theDoc.Rect.String;
for (int i = 1; i <= theCount; i++)
{
theDoc.PageNumber = i;
theDoc.AddImageHtml(content);
}
}
private void CreateDocFooter(Doc theDoc, int theCount, string content)
{
theDoc.Rect.String = "0 200 600 10";
theDoc.MediaBox.String = theDoc.Rect.String;
for (int i = 1; i <= theCount; i++)
{
theDoc.PageNumber = i;
theDoc.AddImageHtml(content);
}
}
private void CreateDocContent(Doc theDoc, int theID, string theContent, ref int theCount)
{
theDoc.Rect.String = "0 800 600 10";
theDoc.MediaBox.String = theDoc.Rect.String;
theID = theDoc.AddImageHtml(theContent);
while (theDoc.Chainable(theID))
{
theDoc.Page = theDoc.AddPage();
theID = theDoc.AddImageToChain(theID);
}
theCount = theDoc.PageCount;
}
有人吗?
【问题讨论】: