1

我正在使用 AbcPdf 库将 aspx 页面转换为 pdf 对象。我已经实现了我的目标,但我有一个问题。aspx 页面中的数据是一组表,它们是动态的,我的意思是,它可以是 2 个表,也可以是 30 个表。我已经实现,当表的数量大于一页时,库会创建所需的页面,但问题是它会截断表。

问题: AbcPdf 库中有什么方法可以在表格或对象的数量大于一页时不截断它们?

4

1 回答 1

0

这是效果很好的示例代码:

http://www.websupergoo.com/helppdf7net/source/4-examples/13-pagedhtml.htm

Doc theDoc = new Doc();
theDoc.Rect.Inset(72, 144);

theDoc.Page = theDoc.AddPage();
int theID;
theID = theDoc.AddImageUrl("http://www.yahoo.com/");

while (true) {
  theDoc.FrameRect(); // add a black border
  if (!theDoc.Chainable(theID))
    break;
  theDoc.Page = theDoc.AddPage();
  theID = theDoc.AddImageToChain(theID);
}

for (int i = 1; i <= theDoc.PageCount; i++) {
  theDoc.PageNumber = i;
  theDoc.Flatten();
}

theDoc.Save(Server.MapPath("pagedhtml.pdf"));
theDoc.Clear();
于 2011-04-05T13:32:44.987 回答