Zooming

This guide shows how to programmatically manage the zoom scale of a PDF page.

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.

Disabling 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;
}]];