首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用AbcPdf截断表

用AbcPdf截断表
EN

Stack Overflow用户
提问于 2010-08-23 11:18:05
回答 1查看 770关注 0票数 1

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

问题:当表或对象的数量大于一页时,AbcPdf库中是否存在不截断表或对象的方法?

EN

回答 1

Stack Overflow用户

发布于 2011-04-05 13:32:44

下面是工作良好的示例代码:

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

代码语言:javascript
复制
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();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3547010

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档