2010-08-23 101 views
1

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

问题: AbcPdf库中有没有任何方法可以在表格或对象数量大于一页时截断表格或对象?

+0

是生成的PDF永远只有一个页面?如果您使用AddImageUrl方法,您可以发布用于链接文档的代码吗? – Jakkwylde 2010-09-21 15:26:44

回答

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();