Extracting text from PDF : PDFLib vs PDF extract vs pdf2xml [closed]
-
04-10-2019 - |
Question
I am looking for a library (if possible available in Java or PHP) in order to extract text from a PDF. There is a lot of software available, including:
3-Heights™ PDF Extract http://www.pdf-tools.com/pdf/pdf-extract-content-metadata-text.aspx
PDFlib TET – Text Extraction Toolkit http://www.pdflib.com/products/tet/
Which tools would you choose? What do you think of them?
Thank you very much for your kind help!
Solution
My favourite is iText (java) but extracting text from a PDF can be fraught with difficulties as the text in the PDF is not alway stored in the order in which it appears.
OTHER TIPS
itext had trouble properly extracting text from the irs i1040.pdf as reported here:
<1> article.gmane.org/gmane.comp.java.lib.itext.general/65680
As near as I can figure out, when the fonts are embedded, it's not always possible to get the right text extracted. See: <2> www.verypdf.com/wordpress/201109/pdf-to-text-converter-cant-extract-text-which-render-by-embedded-fonts-2452.html <3> section 9.10.1 of: www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
<3> says:
If a font is not defined in one of these ways ... the characters cannot be converted to Unicode values without additional information.
I assume that "conversion to unicode values" is essential for text extraction.