java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeLo(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy.getResultantText(LocationTextExtractionStrategy.java:105)
at com.itextpdf.text.pdf.parser.PdfTextExtractor.getTextFromPage(PdfTextExtractor.java:73)
at Java_read.Pdf_read.main(Pdf_read.java:58)
=========Exception======Comparison method violates its general contract!
We are trying to extract data from a pdf but for some pdf's i am getting this error but when we change the strategy to "SimpleTextStrategy" it is extracting the data but in a non sequential manner. So do i need to add libraries for itextpdf?
java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.ComparableTimSort.mergeLo(Unknown Source) at java.util.ComparableTimSort.mergeAt(Unknown Source) at java.util.ComparableTimSort.mergeCollapse(Unknown Source) at java.util.ComparableTimSort.sort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.ArrayList.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at com.itextpdf.text.pdf.parser.LocationTextExtractionStrategy.getResultantText(LocationTextExtractionStrategy.java:105) at com.itextpdf.text.pdf.parser.PdfTextExtractor.getTextFromPage(PdfTextExtractor.java:73) at Java_read.Pdf_read.main(Pdf_read.java:58) =========Exception======Comparison method violates its general contract!
We are trying to extract data from a pdf but for some pdf's i am getting this error but when we change the strategy to "SimpleTextStrategy" it is extracting the data but in a non sequential manner. So do i need to add libraries for itextpdf?