Objective c 应用程序创建的pdf格式的新页面

Objective c 应用程序创建的pdf格式的新页面,objective-c,ipad,ios6,Objective C,Ipad,Ios6,我有一个应用程序,它可以创建一个pdf格式的报告,效果很好,但是报告现在已经进入第二页。如何开始新页面 用于生成pdf的方法是: UIGraphicsBeginPDFContextToFile(filepath), CGRectZero, nil) UIGraphicsBeginPDFPageWithInfo (CGRectMake(0, 0, 792, 1122), nil) 用于在页面上绘制对象的所有代码 我尝试过使用CGPDFContextBeginPage,但我一无所获 只需再次调用U

我有一个应用程序,它可以创建一个pdf格式的报告,效果很好,但是报告现在已经进入第二页。如何开始新页面

用于生成pdf的方法是:

UIGraphicsBeginPDFContextToFile(filepath), CGRectZero, nil)
UIGraphicsBeginPDFPageWithInfo (CGRectMake(0, 0, 792, 1122), nil)
用于在页面上绘制对象的所有代码


我尝试过使用
CGPDFContextBeginPage
,但我一无所获

只需再次调用
UIGraphicsBeginPDFPageWithInfo()
即可开始新页面:

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