2010-08-23 69 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();