---
title: "Android PDF viewer with zoom library | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/miscellaneous/zooming/"
md_url: "https://www.nutrient.io/guides/android/miscellaneous/zooming.md"
last_updated: "2026-06-09T10:25:14.356Z"
description: "Learn to programmatically manage the zoom scale of a PDF page. for Nutrient Android SDK."
---

# Customizing zoom options in our Android PDF viewer

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

## Manual zooming

`PdfFragment` allows you to programmatically zoom to a certain scale or to an area of a PDF document page using a convenient zooming API.

- [`PdfFragment#zoomTo(RectF, int, long)`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-to.html) allows you to zoom to a specific `RectF` on the given page.

- [`PdfFragment#zoomTo(int, int, int, float, long)`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-to.html) lets you zoom to a focus point at the given scale.

Both methods take _PDF page coordinates_. To find out more on that topic, see the [guide on coordinate space conversion](https://www.nutrient.io/../../faq/coordinate-spaces).

You can also get the current zoom level of a page by calling [`PdfFragment#getZoomScale`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/get-zoom-scale.html).

## Zooming in to the page

You can programmatically zoom in to the current page using [`zoomTo`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-to.html), which zooms to a specific scale. If you'd like to apply a scale factor to the current scale (e.g. increase page scale by 2), you can use [`zoomBy`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-by.html). Furthermore, you can use [`zoomTo(RectF,...)`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-to.html) to zoom in to a [`RectF`](https://developer.android.com/reference/android/graphics/RectF.html) of any page (e.g. zoom in to a sentence or annotation):

### KOTLIN

```kotlin

// Zoom to the annotation.
val duration = 250L
fragment.zoomTo(annotation.boundingBox, annotation.pageIndex, duration)

```

### JAVA

```java

RectF annotationPosition = annotation.getBoundingBox();
int page = annotation.getPageIndex();
long duration = 250;

// Zoom to the annotation.
fragment.zoomTo(annotationPosition, page, duration);

```

[`zoomTo(RectF,...)`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/zoom-to.html) will automatically go to the given page if some other page is currently being viewed. There's no need to switch the page manually!

For more information on zooming, you can try out the `ZoomExample` inside our Catalog app.

## Starting the document at a given scale

A document can be started at an already predetermined scale (on the given page). Note that rotating the screen resets the scale. The property that controls this is `startZoomScale` in `PdfConfiguration`:

### KOTLIN

```kotlin

val configuration = PdfConfiguration.Builder().startZoomScale(3.0f).build()

```

### JAVA

```java

final PdfConfiguration configuration = new PdfConfiguration.Builder().startZoomScale(3.0f).build();

```

## Disabling zooming

Zooming can be disabled by setting `maxZoomScale` of `PdfConfiguration` to `1`. It’s important to set this value before creating the view:

### KOTLIN

```kotlin

val configuration = PdfConfiguration.Builder().maxZoomScale(1.0f).build()

```

### JAVA

```java

final PdfConfiguration configuration = new PdfConfiguration.Builder().maxZoomScale(1.0f).build();

```
---

## Related pages

- [Android image viewer library](/guides/android/viewer/images.md)
- [Android PDF viewer library](/guides/android/viewer.md)
- [Customizing page navigation in our Android PDF viewer](/guides/android/basics/document-interactions.md)
- [Configuring scroll directions and page transitions in our Android viewer](/guides/android/customizing-the-interface/document-presentation-options.md)
- [Fast and feature-rich PDF viewer for Android apps](/guides/android/viewer/kotlin.md)
- [Create efficient Android PDF viewers for apps](/guides/android/viewer/java.md)
- [Enhance your Android PDF viewer with JavaScript support](/guides/android/features/javascript.md)
- [Mastering PDF permissions in Android apps](/guides/android/viewer/permissions.md)
- [Android PDF  iewer troubleshooting](/guides/android/viewer/troubleshooting.md)
- [Selecting text in Android PDF viewer](/guides/android/features/text-selection.md)
- [Using the view state to display PDFs on Android](/guides/android/view-management/store-load-view-state.md)

