5

Seems like Solr is not parsing my PDF files correctly. I was wondering if there is any other alternative to using Apache Tika (which I believe uses PDFBox internally) for parsing PDF files? I seem to be getting random spaces in between my content when using this. I have isolated the problem by running PDF through PDFBox directly (latest version) which has the same problem.

Some OCR commercial software such as Omnifind work on PDF fine but we are not able to integrate them with Solr in same way and buying is not an option either.

Ravish Bhagdev
  • 955
  • 1
  • 13
  • 27
  • What version of Tika are you using? – Gagravarr Nov 16 '11 at 10:04
  • I've tried with 0.10, I think 1.0 just came out, haven't tried that yet. Will give it a shot tomorrow! Thanks. – Ravish Bhagdev Nov 16 '11 at 23:39
  • 1
    The PDFBox team are actively working on the project, and each new release tends to improve things, so it's worth trying a newer Tika+PDFBox to see if it helps – Gagravarr Nov 17 '11 at 09:45
  • Thanks for that. Yes, I tried with latest version of Tika 1.0 which I believe also uses latest version of PDFBox, it did improve things visibly when I used the new parameter they have added for turning off the auto spacing. However, still not quite perfect on documents I am trying on. – Ravish Bhagdev Nov 17 '11 at 15:57

3 Answers3

2

As the answer to this SO question indicates, this is due to the nature of the PDF format itself.

It's possible that OCR options do better on this problem than PDFBox, there are some free OCR options available like Tesseract and Ocropus but I have no idea how well they work or if they can be easily integrated with Solr.

Community
  • 1
  • 1
Tom De Leu
  • 8,144
  • 4
  • 31
  • 30
  • Thanks, I understand, but I am just trying and looking for alternatives so I can list which ones work best on what kind of documents. I am not looking for perfect solution since I read that reply :) – Ravish Bhagdev Nov 16 '11 at 23:41
1

Xpdf contains pdftotext which converts documents a lot better then Tika.

Okke Klein
  • 2,549
  • 17
  • 9
1

I use jpod as a fallback library to extract from pdf when pdfbox fails completely (hang, crash...), so at least in some cases it works better than pdbbox for me.

Persimmonium
  • 15,593
  • 11
  • 47
  • 78