Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside work, he’s a 1900‑rated chess player, guitarist, and French learner.

Apache Tika PDF support in JPedal

1 min read

Apache tika pdf

JPedal now contains an Apache Tika Parser which can parse and extract structured and unstructured text from PDF files.

How to use an Apache Tika PDF Parser

The integration allows you to use Tika’s parse() method with JPedal, giving you streamlined access to robust PDF text extraction and all the additional metadata and error-handling capabilities from both libraries.

How JPedal Implements Apache Tika PDF Parsing

First, you must pass a TikaInputStream containing the path to your PDF file.

Second, you must pass a ContentHandler. It is advisable to set the character limit to -1 otherwise, the whole PDF file may not be parsed.

Next, you pass a Metadata. This can be a blank instance or it can contain the password to the PDF file if it is encrypted.

Finally, a ParseContext is not needed so the last argument can be null.

The extracted text is now stored in the ContentHandler!

Key Parameters

  • InputStream: Use TikaInputStream for path input. The stream is consumed (not closed automatically), so you should manually close it after parsing.
  • ContentHandler: Stores extracted content. It’s recommended to set the character limit to -1 to ensure the entire PDF is parsed.
  • Metadata: Can be a blank instance or contain the PDF password if needed.
  • ParseContext: Optional; not required for JPedal usage.

Sample Usage

Learn More

You can find more information about our Apache Tika Parser here.

By leveraging JPedal’s Apache Tika integration, Java developers gain a fully-supported, enterprise-grade solution for PDF parsing with consistent API design, easy handling of unstructured text, and built-in extensibility for more advanced PDF tasks.



The JPedal PDF library allows you to solve these problems in Java


Jacob Collins Jacob is the JPedal Product Lead and specialises in PDF creation and manipulation. He also develops Salesforce backend systems and contributes to marketing and support. Outside work, he’s a 1900‑rated chess player, guitarist, and French learner.

Easily convert PDF to HTML in Java (Tutorial)

PDF to HTML conversion helps improve your PDF content for browser display. BuildVu is one of the leading PDF to HTML solution for developers....
Leon Atherton
1 min read