tabulizer provides R bindings to the Tabula java library, which can be used to computationaly extract tables from PDF documents.

Note: tabulizer is released under the MIT license, as is Tabula itself.


tabulizer depends on rJava, which implies a system requirement for Java. This can be frustrating, especially on Windows. The preferred Windows workflow is to use Chocolatey to obtain, configure, and update Java. You need do this before installing rJava or attempting to use tabulizer. More on this and troubleshooting below.

To install the latest CRAN version:


To install the latest development version:

if (!require("remotes")) {
# on 64-bit Windows
remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch")
# elsewhere
remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"))

Code Examples

The main function, extract_tables() provides an R clone of the Tabula command line application:

By default, it returns the most table-like R structure available: a matrix. It can also write the tables to disk or attempt to coerce them to data.frames using the output argument. It is also possible to select tables from only specified pages using the pages argument.

It is also possible to manually specify smaller areas within pages to look for tables using the area and columns arguments to extract_tables(). This facilitates extraction from smaller portions of a page, such as when a table is embeded in a larger section of text or graphics.

Another function, extract_areas() implements this through an interactive style in which each page of the PDF is loaded as an R graphic and the user can use their mouse to specify upper-left and lower-right bounds of an area. Those areas are then extracted auto-magically (and the return value is the same as for extract_tables()). Here’s a shot of it in action:


locate_areas() handles the area identification process without performing the extraction, which may be useful as a debugger.

extract_text() simply returns text, possibly separately for each (specified) page:

Note that for large PDF files, it is possible to run up against Java memory constraints, leading to a java.lang.OutOfMemoryError: Java heap space error message. Memory can be increased using options(java.parameters = "-Xmx16000m") set to some reasonable amount of memory.

Some other utility functions are also provided (and made possible by the Java Apache PDFBox library):

Installing Java on Windows with Chocolatey

In command prompt, install Chocolately if you don’t already have it:

Then, install java using Chocolately’s choco install command:

You may also need to then set the JAVA_HOME environment variable to the path to your Java installation (e.g., C:\Program Files\Java\jdk1.8.0_92). This can be done:

  1. within R using Sys.setenv(JAVA_HOME = "C:/Program Files/Java/jdk1.8.0_92") (note slashes), or
  2. from command prompt using the setx command: setx JAVA_HOME C:\Program Files\Java\jdk1.8.0_92, or
  3. from PowerShell, using the .NET framework: [Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Java\jdk1.8.0_92", "User"), or
  4. from the Start Menu, via Control Panel » System » Advanced » Environment Variables (instructions here).

You should now be able to safely open R, and use rJava and tabulizer. Note, however, that some users report that rather than setting this variable, they instead need to delete it (e.g., with Sys.setenv(JAVA_HOME = "")), so if the above instructions fail, that is the next step in troubleshooting.


Some notes for troubleshooting common installation problems:

  • On Mac OS, you may need to install a particular version of Java prior to attempting to install tabulizer.
  • On a Unix-like, you need to ensure that R has been installed with Java support. This can often be fixed by running R CMD javareconf on the command line (possibly with sudo, etc. depending on your system setup).
  • On Windows, make sure you have permission to write to and install packages to your R directory before trying to install the package. This can be changed from “Properties” on the right-click context menu. Alternatively, you can ensure write permission by choosing “Run as administrator” when launching R (again, from the right-click context menu).