From Apple's Sample Code of Zooming PDF Viewer
UIScrollView имеет API, чтобы сделать это
[yourScrollView zoomToRect:CGRectMake(X, Y, Width, Height) animated:YES];
В принципе, если вы хотите, чтобы увидеть анимацию на ваших изменений, то вы можете поместить свой код в View Появлялись метод.
#import "ZoomingPDFViewerViewController.h"
#import "PDFScrollView.h"
#import <QuartzCore/QuartzCore.h>
@implementation ZoomingPDFViewerViewController
- (void)viewDidLoad
{
[super viewDidLoad];
/*
Open the PDF document, extract the first page, and pass the page to the PDF scroll view.
*/
NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"TestPage" withExtension:@"pdf"];
CGPDFDocumentRef PDFDocument = CGPDFDocumentCreateWithURL((__bridge CFURLRef)pdfURL);
CGPDFPageRef PDFPage = CGPDFDocumentGetPage(PDFDocument, 1);
[(PDFScrollView *)self.view setPDFPage:PDFPage];
CGPDFDocumentRelease(PDFDocument);
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
// 1. Get the Scroll View
UIScrollView *scrollView = (UIScrollView*)self.view;
// 2. Zoom to specified rect
[scrollView zoomToRect:CGRectMake(X, Y, Width, Height) animated:YES];
}