Zooming

Manual Zooming

You can use PDFDocumentViewController.zoom(toPDFRect:forPageAt:animated:) to zoom to a specific rect inside a page of the current document.

Note: This method’s rect needs to be specified in pdf coordinates.

Disable Zooming

Zooming can be disabled by setting the maximumZoomScale of PDFConfiguration to 1. It’s important to set this value before creating the view. Alternatively you can set zoomEnabled to NO on PDFDocumentViewController.

1
2
3
let controller = PDFViewController(document: document) {
    $0.maximumZoomScale = 1
}
Copy
1
2
3
PSPDFViewController *controller = [[PSPDFViewController alloc] initWithDocument:document configuration:[PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    builder.maximumZoomScale = 1.0f;
}]];