Read text from a PDF document

Read the text from a simple PDF document into MATLAB as a string


Updated 3 Jul 2017

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

% PDFREAD reads a PDF file using the iText java library.
% String specifying the location of the PDF.
% Cell array, each cell corresponds to each page of the parsed PDF
% file. Images are not extracted, only text.
% D. Wood, 7/3/2017
This software uses the open-source iText library.
The source .jar is included in the zip file, but more information can be found here:
Before the included pdfRead() function can be executed, simply run this command once:
The command can be run via console or script, but only needs to be done once.
This method is relatively robust, however it will not always return all the text in the document if the PDF has an unusual or complicated formatting (i.e. multiple non-fixed-width columns or excessive image captions).

Cite As

Derek Wood (2023). Read text from a PDF document (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

(Updated description text slightly)
(Updated text again)
(Text again)
(I added a title image)