3 ms·
I have explained the details in other comments, have a look. But you can start by looking at pdftotext from Poppler, it is ready to go for 60-70% of cases with
by throwaway4496 1y ago
I have explained the details in other comments, have a look. But you can start by looking at pdftotext from Poppler, it is ready to go for 60-70% of cases with -layout flag, with bbox-layout you get even more details.
- dotancohen 1y agoThank you. Even with box layout one can not even know that there is a coherent word or phrase to extract, without visually inspecting the PDF beforehand. I've been there, fighting with it right in the CLI and finding that there is no way to even progress to a script. The advantage of the OCR method is that it effectively performs that visual inspection. That's why it is preferable for PDFs of disparate origin.
- throwaway4496 1y agoWhat kind of semantics can you infer from the text of OCRing a bitmap that you can't infer from the text generated directly from the PDF? Is it the lack of OCR mistakes? The hallucinations? Or something else?
- dotancohen 1y agoIn the cases that I've seen, the PDF software does not generate text strings. It generates individual letters. It is up to any application to try to figure out how those individual letters relate to one another.
- throwaway4496 1y agoDid you even read my comment? The "application" is called pdftotext, and instead of putting the individual letters on a bitmap, it puts them in a string literal.
- dotancohen 1y agoI do not understand why you insist on being polemic to win an internet argument, when I'm giving you all the tools to win the internet argument by virtue of being correct. I did read your comment, because my intention here is to learn. I already described how tools such as pdftotext do not produce strings when each letter is positioned independently. I even gave an example of a few replies up.