pdf创建的新页面由app创建

时间:2013-05-10 11:44:01

标签: objective-c ipad ios6

我有一个以pdf形式创建报告的应用程序,该报告工作正常,但报告现在转到第二页。如何开始新页面?

用于生成pdf的方法是:

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

在网页上绘制对象的所有代码

UIGraphicsEndPDFContext();

我尝试过使用CGPDFContextBeginPage,但我无处可去。

1 个答案:

答案 0 :(得分:1)

只需再次拨打UIGraphicsBeginPDFPageWithInfo()即可开始新页面:

UIGraphicsBeginPDFContextToFile(...); 
UIGraphicsBeginPDFPageWithInfo(...);
// ... code for drawing the first page ...
UIGraphicsBeginPDFPageWithInfo(...);
// ... code for drawing the second page ...
UIGraphicsEndPDFContext();
相关问题