I'm trying to parse pdf files in tika. In some handwritten scanned documents, tika is parsing the file and returning garbage text that does not make sense. I'm using python tika wrapper from here. Is there some way to ignore pdfs that contain images. Tesseract OCR parser is turned off. It is not displayed in metadata after parsing the file.
Asked
Active
Viewed 715 times
0
-
Is the OCR'd text actually stored in the PDF? If you open the PDF in Acrobat and select + copy + paste, does the bad text come out? – Gagravarr Sep 10 '20 at 08:01
-
No. The pdf is simply a pdf containing a handwritten scanned image – pramesh Sep 10 '20 at 09:32
1 Answers
1
to ignore the inline images you should use the flag "X-Tika-PDFextractInlineImages: false"
pdfParserConfig.setExtractInlineImages(false)
but to be honest setting the value to false has sense only for the "native pdf"
for the scanned documents this flag has to be set to true than only way to improve the process is to turn on the ocr and use the OcrStrategy: OCR_ONLY

marek.kapowicki
- 674
- 2
- 5
- 17