0

I am receiving the EI not found error in this specific pdf found under https://bfs.ever-team.com/files/6fce4cef9769e40d1994e684a881d4bf/facture3_1.pdf.

I am using itextpdf-5.4.3 jar and below is the code:

com.itextpdf.awt.geom.Rectangle rec = new com.itextpdf.awt.geom.Rectangle(307, 728, 742, 400);
RenderFilter filter = new RegionTextRenderFilter(rec);

TextExtractionStrategy  strategy = new FilteredTextRenderListener(new LocationTextExtractionStrategy(), filter);
String currentText = PdfTextExtractor.getTextFromPage(reader, i , strategy);

Method getTextFromPage is returning the error, I checked other threads but it was mentioned that this error should be fixed in the latest jar, but it seems it is not facture3_1.pdfworking for my file. Can anyone advise please.

user2318955
  • 95
  • 10
  • 1
    *it was mentioned that this error should be fixed in the latest jar, but it seems it is not* - it is fixed... which you would realize if you *used* the latest jars. For details cf. [my reply](http://itext-general.2136553.n4.nabble.com/itextpdf-5-4-3-throwing-com-itextpdf-text-pdf-parser-InlineImageUtils-InlineImageParseException-EI-na-tp4660457p4660458.html) to your cross-post on the iText mailing list. – mkl Oct 16 '14 at 09:54
  • Thanks, i saw your reply, it fix the problem. – user2318955 Oct 16 '14 at 11:21

1 Answers1

2

A crosspost of this question has been answered on the iText mailing list. To close the question here, too, that answer is copied here:

The issue can be reproduced with iText 5.4.3 but not with the current development snapshot. The OP, therefore, should update his iText version.

InlineImageParseException: EI not found after end of image data

EI denotes the end of an inline image. The handling of inline images is tricky and not strictly well-defined. iText recently improved its handling of inline images to correctly parse more PDFs with such inline images.

mkl
  • 90,588
  • 15
  • 125
  • 265