Why is the state of the art in PDF parsing SO BAD? This is an incredibly common and important problem. Tika and fitz have very poor results. What is the reason that this is still so backwards?
PDF has always seemed to be a janky Adobe product. Should a modern, open version of PDF be created knowing that how it evolved from the original concept in 1991? Shouldn't we at some point say, we need to start over and created PDF2?
Show HN: I am building a new Python library to read/write PDF files
21–30 of 126 posts
Re: Show HN: I am building a new Python library to read/write PDF files
#22Is there a list of open source PDF libraries for various languages? And related: the best tools to generate PDFs from HTML.
"list" is probably harsh, but I've had good luck trawling through the GitHub topics to find such things: https://github.com/search?p=1&q=topic%3Apdf&type=Repositorie... Makes me miss freshmeat.net which would have been my answer a few years ago (freshcode.club just isn't the same, although bless them for trying)
She was, to put it mildly, immediately suspicious of my browsing habits.
Re: Show HN: I am building a new Python library to read/write PDF files
#23Why is the state of the art in PDF parsing SO BAD? This is an incredibly common and important problem. Tika and fitz have very poor results. What is the reason that this is still so backwards?
PDF has always seemed to be a janky Adobe product. Should a modern, open version of PDF be created knowing that how it evolved from the original concept in 1991? Shouldn't we at some point say, we need to start over and created PDF2?
Unfortunately in practice it would mean that everyone would have to support both PDF and PDF2.
Re: Show HN: I am building a new Python library to read/write PDF files
#24Why is the state of the art in PDF parsing SO BAD? This is an incredibly common and important problem. Tika and fitz have very poor results. What is the reason that this is still so backwards?
PDF has always seemed to be a janky Adobe product. Should a modern, open version of PDF be created knowing that how it evolved from the original concept in 1991? Shouldn't we at some point say, we need to start over and created PDF2?
Re: Show HN: I am building a new Python library to read/write PDF files
#25Why is the state of the art in PDF parsing SO BAD? This is an incredibly common and important problem. Tika and fitz have very poor results. What is the reason that this is still so backwards?
For example, I once had to try to parse PDF invoices generated by some legacy system, and at the bottom was a line that read something like, "Total: $32.56". But in the PDF there was an instruction to write out the string "Total:" and a separate one to write out the amount string, but there was nothing in the PDF itself that correlated the two in any way at all (they didn't appear anywhere close to either other in the page's hierarchy, they weren't at a fixed set of coordinates, etc, etc.).
Re: Show HN: I am building a new Python library to read/write PDF files
#26PyPDF [1] is great for reading and writing PDF files, especially dealing with pages, but it’s not great for generating paths, shapes, graphics, etc.
However, reportlab [2] has a great API for generating those things, but is lacking in the file IO and page management department. But the content streams it generates can be plugged into PyPDF pretty easily.
Finally, there’s pdfplumber which does an amazing job of parsing tabular data from PDF structures, and pytesseract which can perform OCR on PDFs that are actually just image data rather than structured data.
There’s not really a one-stop-shop for PDFs, but some pretty good tools that can be combined to get the job done.
Will be curious to see how this project develops!
Re: Show HN: I am building a new Python library to read/write PDF files
#27Earlier quoted context omitted.
What libraries do you see as being SOTA? Fitz? Tika? My hope is that computer vision + OCR will solve this once and for all in near future.
OCR is built into Adobe's PDF reader, issue is it's 15$ a month. I really want to see OCR become easier to use, but I don't know why it's such a hard problem in the first place.
I believe it uses tesseract, ghostscript and some other libraries.
Speaking of ghostscript, one way to deal with problematic PDFs is to print them to file and deal with the result instead.
Re: Show HN: I am building a new Python library to read/write PDF files
#28Why is the state of the art in PDF parsing SO BAD? This is an incredibly common and important problem. Tika and fitz have very poor results. What is the reason that this is still so backwards?
PDF has always seemed to be a janky Adobe product. Should a modern, open version of PDF be created knowing that how it evolved from the original concept in 1991? Shouldn't we at some point say, we need to start over and created PDF2?
Re: Show HN: I am building a new Python library to read/write PDF files
#29On the field of PDF parsing, I think the most interesting project I encountered is pdfquery[1], where the PDF is parsed as a XML tree and you can use XPath to query it. You might encounter rough edges when put it into production work but the idea is like “how come i never thought of this” because PDF has some tree like structure and should be a straightforward solution. [1]: https://github.com/jcushman/pdfquery
https://pdfminersix.readthedocs.io/en/latest/reference/comma...
Re: Show HN: I am building a new Python library to read/write PDF files
#30I would be willing to help make this happen, but I do not know much about the PDF format.