tabula-java
tabula-java copied to clipboard
IndexOutOfBoundsException: Index 0 out of bounds for length 0
Version 1.3.0 crashes with IndexOutOfBounsException.
To reproduce:
- Download PDF file:
wget https://www.sec.gov/files/formcustody.pdf - Run tabula:
java -Dfile.encoding=UTF8 -jar tabula-1.0.3-jar-with-dependencies.jar \ --pages 7 --area 70.847,72.698,178.03,564.261 \ --stream --format JSON formcustody.pdf
Getting this:
Feb 26, 2020 1:58:35 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSerif' for 'TimesNewRomanPSMT'
Feb 26, 2020 1:58:35 PM org.apache.pdfbox.pdmodel.font.PDTrueTypeFont <init>
WARNING: Using fallback font 'LiberationSerif-Bold' for 'TimesNewRomanPS-BoldMT'
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at technology.tabula.extractors.BasicExtractionAlgorithm.columnPositions(BasicExtractionAlgorithm.java:114)
at technology.tabula.extractors.BasicExtractionAlgorithm.extract(BasicExtractionAlgorithm.java:63)
at technology.tabula.CommandLineApp$TableExtractor.extractTablesBasic(CommandLineApp.java:416)
at technology.tabula.CommandLineApp$TableExtractor.extractTables(CommandLineApp.java:390)
at technology.tabula.CommandLineApp.extractFile(CommandLineApp.java:175)
at technology.tabula.CommandLineApp.extractFileTables(CommandLineApp.java:128)
at technology.tabula.CommandLineApp.extractTables(CommandLineApp.java:109)
at technology.tabula.CommandLineApp.main(CommandLineApp.java:79)