[英]Problem with using quartz 2d to draw a PDF
我在使用石英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);
}
我知道我可以將x更改為1以獲取頁面,但是如何重畫框架?
CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);
進行視圖重畫調用
[view setNeedsDisplay];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.