使用quartz 2d绘制PDF的问题

时间:2010-08-28 13:51:15

标签: iphone pdf quartz-graphics

我有石英2d绘制pdf的问题,我把它拿起并运行良好

但我不太确定如何进入下一页

这是代码

-(void)drawInContext:(CGContextRef)context{

     CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
     CGContextScaleCTM(context, 1.0, -1.0);

     CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);
     CGContextSaveGState(context);

     CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, self.bounds, 0, true);

     CGContextConcatCTM(context, pdfTransform);

     CGContextDrawPDFPage(context, page);
     CGContextRestoreGState(context);
}

我知道我可以将1更改为x以获取页面但是如何重绘框架?

CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);

1 个答案:

答案 0 :(得分:0)

进行视图重绘调用

[view setNeedsDisplay];