The Ultimate Java PDF Library SDK

Seamless PDF Integration for Java

Download Trial Purchase

How to Find Text in a PDF File

Learn More on JPedal Text Search

 

The link below provide links to Javadocs including sample source code for finding text in a PDF.

A note on co-ordinates

Examples use the PDF co-ordinates which start at bottom left of page and run up the page. This is the opposite of Java (which run from top left down page).

Search Type

For complex searches, you can set a  SearchType. Valid values are

These values can be combined by using the bitwise or operator. For example,

int searchType = SearchType.WHOLE_WORDS_ONLY | SearchType.CASE_SENSITIVE;

IDRSolutions Limited 1999-2016