【发布时间】:2014-02-18 13:29:05
【问题描述】:
我重写了 drawLayer 方法来绘制 pdf 的特定页面。如何剪辑页面的一部分并显示相同的内容。
- (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context
{
CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White
CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // Fill
CGContextTranslateCTM(context, 0.0f, self.bounds.size.height); CGContextScaleCTM(context, 1.0f, -1.0f);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(_PDFPageRef, kCGPDFCropBox, self.bounds, 0, true));
CGContextDrawPDFPage(context, _PDFPageRef);
}
【问题讨论】:
标签: ios objective-c pdf core-graphics quartz-2d