开发者

how to go to next page of pdf in objective-c if pdf have multi pages

i have multi pages pdf,i want to go to the next page of pdf开发者_Python百科, how to go this.


(page -> the page you want to display, pdfReference: a reference to a CGPDFDocumentRef)

  pageReference = CGPDFDocumentGetPage(pdfReference, page);
  CGContextRef context = UIGraphicsGetCurrentContext();
  @try {
    CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
    CGContextScaleCTM(context, scale, -scale);

    CGContextSaveGState(context);
    CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(pageReference, kCGPDFCropBox, self.bounds, 0, true);
    CGContextConcatCTM(context, pdfTransform);
    CGContextDrawPDFPage(context, pageReference);
    CGContextRestoreGState(context);
  }
  @finally {
    UIGraphicsEndImageContext();
  }

insert this into a drawRect:(CGRect) and you are fine to go

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜