2013-05-10 54 views
0

我有一個應用程序可以在PDF格式的表單中創建報告,但工作正常,但是報告現在轉到第二頁上。我如何開始新的頁面?由pdf創建的pdf格式的新頁面

用於生成PDF的方法是:

UIGraphicsBeginPDFContextToFile(filepath), CGRectZero, nil) 
UIGraphicsBeginPDFPageWithInfo (CGRectMake(0, 0, 792, 1122), nil) 

繪製頁

UIGraphicsEndPDFContext(); 

我已經使用了CGPDFContextBeginPage試圖在對象上的所有代碼,但我越來越行不通。

回答

1

再打電話UIGraphicsBeginPDFPageWithInfo(),開始了新的一頁:

UIGraphicsBeginPDFContextToFile(...); 
UIGraphicsBeginPDFPageWithInfo(...); 
// ... code for drawing the first page ... 
UIGraphicsBeginPDFPageWithInfo(...); 
// ... code for drawing the second page ... 
UIGraphicsEndPDFContext(); 
+0

謝謝 - 好和簡單。 – RGriffiths 2013-05-11 08:16:43