Apache Tika PDF support in JPedal

29 sec read

Apache tika pdf

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

How to use an Apache Tika PDF Parser

Just like any other Apache Tika Parser, you must call the parse() method with a few parameters.

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!

Learn More

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

Our software helps Java Developers to

View PDF files in a web application →

Parse PDF files as HTML →

Display PDF Forms in a web browser →

View PDF Documents in Java Applications →

Rasterize PDF Documents to image →

Read/Write images (including HEIC, JPG and WEBP) →

Convert Image files to PDF Documents →

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2022. All rights reserved.