0
votes

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.

1
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
No. The pdf is simply a pdf containing a handwritten scanned imagepramesh

1 Answers

1
votes

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