---
title: "Load a PDF document on Android with PdfDocument class | Nutrient"
canonical_url: "https://www.nutrient.io/guides/android/basics/using-pdfdocument/"
md_url: "https://www.nutrient.io/guides/android/basics/using-pdfdocument.md"
last_updated: "2026-06-09T10:25:14.356Z"
description: "Nutrient represents loaded PDF documents using instances of the PdfDocument class. A document can be loaded from various sources."
---

# Load PDF documents on Android with PdfDocument class

Nutrient represents loaded PDF documents using instances of the [`PdfDocument`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/index.html) class. A document can be loaded from various sources, including the app’s assets, the local device storage, a content provider, or any custom data source of your app.

## Load documents

The [`PdfDocumentLoader`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document-loader/index.html) class offers various methods for loading and opening PDF documents in a synchronous or asynchronous fashion. [`DocumentSource`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-document-source/index.html) gives developers a generic structure to define the input source of a document. You can create a document source from a [`Uri`](https://developer.android.com/reference/android/net/Uri.html) or [`DataProvider`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document.providers/-data-provider/index.html):

### KOTLIN

```kotlin

// Using an Android Uri.
val document = PdfDocumentLoader.openDocument(Uri.fromFile(File("/path/to/document.pdf")))

// Using a custom `DataProvider`.
val assetsDataSource = DocumentSource(AssetDataProvider("document.pdf"))
val document = PdfDocumentLoader.openDocument(context, assetsDataSource)

```

### JAVA

```java

// Using an Android Uri.
PdfDocument document = PdfDocumentLoader.openDocument(context, Uri.fromFile(new File("/path/to/document.pdf")));

// Using a custom `DataProvider`.
DocumentSource assetsDataSource = new DocumentSource(new AssetDataProvider("document.pdf"));
PdfDocument document = PdfDocumentLoader.openDocument(context, assetsDataSource);

```

> To see a full list of available methods for loading documents, check out our [API reference](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document-loader/index.html).

## Document structure

Each [`PdfDocument`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/index.html) instance consists of one or more pages (there are no PDF documents with zero pages). To get the total count of pages in a document, use the [`PdfDocument#getPageCount`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/get-page-count.html) method. Page indices are zero-based and are in the half-open interval, `[0, pageCount)`.

### Page coordinates and sizes

Each page of a PDF document has its own coordinate space, which has its origin at the bottom left of the page, with x coordinates increasing to the right of the page, and y coordinates increasing to the top of the page. A detailed explanation of PDF coordinates can be found in our [coordinate space conversions][] guide.

The size of a page (in PDF coordinates) can be retrieved by calling [`PdfDocument#getPageSize`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/get-page-size.html).
---

## Related pages

- [Display PDFs on Android with PdfActivity](/guides/android/basics/using-activity.md)
- [PDF display options on Android with PdfFragment](/guides/android/basics/using-fragment.md)

