---
title: "Extract text from pdfs with android library"
canonical_url: "https://www.nutrient.io/guides/android/features/text-extraction/"
md_url: "https://www.nutrient.io/guides/android/features/text-extraction.md"
last_updated: "2026-06-08T17:11:05.429Z"
description: "Learn how to simplify PDF text extraction on Android using our tools and guides."
---

# Easily extract text from PDFs on Android

Extracting text from a PDF can be a complex task, so we offer several abstractions to make this simpler. In a PDF, text usually consists of glyphs that are absolutely positioned. Nutrient heuristically splits these glyphs up into words and blocks of text. Our user interface leverages this information to allow users to select and annotate text. You can read more about this in our [text selection](https://www.nutrient.io/../../features/text-selection/) guide.

## Reading the text

[`PdfDocument`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/index.html) offers methods that allow you to access text from a given PDF page. It also ensures that the text it extracts from a PDF follows any logical structure defined in the PDF (see section 14.7 of the [PDF specification](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf)), thereby enabling support for correctly handling different text-writing directions. Using [`PdfDocument#getPageText()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.document/-pdf-document/get-page-text.html) like so allows you to get all text found on a single page:

### KOTLIN

```kotlin

val document: PdfDocument =...
val pageText = document.getPageText(0)

```

### JAVA

```java

PdfDocument document =...
String pageText = document.getPageText(0);

```
---

## Related pages

- [PDF extraction library for Android](/guides/android/extraction.md)
- [Extract metadata from PDFs on Android](/guides/android/extraction/metadata.md)
- [Effortlessly parse PDF content on Android](/guides/android/extraction/parse-content.md)
- [Extract pages from PDFs on Android](/guides/android/extraction/page-extraction.md)
- [Extract the text position from PDFs on Android](/guides/android/extraction/text-position.md)
- [Extract selected text from PDFs on Android](/guides/android/extraction/selected-text.md)

