Closed buptyyf closed 1 year ago
Hi @buptyyf, and thanks for your interest in this library. It seems that the PDF is malformed; if you repair it with GhostScript, the code above executes nearly instantaneously.
Hi @buptyyf, and thanks for your interest in this library. It seems that the PDF is malformed; if you repair it with GhostScript, the code above executes nearly instantaneously.
Thanks a lot. How can I check pdf is malformed before I repair it?
I don't have a definitive answer, unfortunately, but a web-search (e.g., for "validate pdf ghostscript") returns some results that make me think it's possible.
I don't have a definitive answer, unfortunately, but a web-search (e.g., for "validate pdf ghostscript") returns some results that make me think it's possible.
I also use another pdf parser lib Pymupdf to parse this pdf. Parsing is very fast, and don't show it's malformed.
Yes, different PDF-parsing programs have different tolerances for malformed documents. In this case, pdfplumber
depends on pdfminer.six
for extracting PDF text/graphics locations, and pdfminer.six
handles malformed PDFs differently than MyPDF
(which is what Pymupdf
uses).
Describe the bug
page.find_tables() cost several minutes and use 100%cpu.
PDF file
CB_7ZM3m03nICqS6eS6cf1hxEKk.pdf
Please attach any PDFs necessary to reproduce the problem.