18 ms·
PDF is easily the worst document format I have ever worked with. I worked on a project that fed the contents of PDF files into Lucene to create a full text inde
by maxxxxx 10y ago
PDF is easily the worst document format I have ever worked with. I worked on a project that fed the contents of PDF files into Lucene to create a full text index. It was a sheer nightmare to extract text from those. Tika worked but a lot of documents still converted to garbled text. I ended up using 4 different PDF to text converters and scored their results by the percentage of known words they returned. That was a few years ago. I'd be curious if things have improved by now.
- dunham 10y agoWe've had good luck with "pdftotext" from poppler/xpdf. The only things that were garbled were intentionally obfuscated. (The files had a mangled character encoding table that was added to the pdf to prevent copy/paste.) You're also gonna have problems with all-image pdfs (scans) that have low quality OCR results layered on top of them. If you want to decode tables, "pdftotext -layout" is a good starting point. If you need more detail, try "pdftohtml -xml -fullfontname".
- maxxxxx 10y agoNow that you mention it I remember pdftotext usually proficed the best results and also was several times faster than tika.