IRONSOFTWAREHOME
Extract Text From PDF


PdfDocument pdf = PdfDocument.renderUrlAsPdf("https://unsplash.com/");
String text = pdf.extractAllText();
System.out.println("Text extracted from the website: " + text);
mvn install
Extract Text From PDF

Extract Text From PDF

As part of IronPDF's extensive collection of PDF creation and editing functions, IronPDF also facilitates granular processing of a PDF document's content through its content extraction methods.

Available on all PdfDocument objects is the extractAllText method. The String that extractAllText returns holds all the text contained on every page in the PDF.

This method is a convenient way to perform document-level extraction of text from PDFs containing many pages. To extract text on a page-level (i.e., just from a specific set of pages), use the extractTextFromPage method instead.

The brief code snippet below pulls the text from the first page of a PDF document.

Explore the extractAllText Method in IronPDF Java Docs
View on GitHub

Ready to Get Started?

Version:2026.8just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Java Maven Library for PDF
Install with Maven

Version: 2026.8

<dependency>
   <groupId>com.ironsoftware</groupId>
   <artifactId>ironpdf</artifactId>
   <version>2026.8.2</version>
</dependency>
https://central.sonatype.com/artifact/com.ironsoftware/ironpdf/2026.8.2
or
Java PDF JAR
Download JAR

Version: 2026.8

Manually install into your project