![PDF Text Extractor avatar](https://images.apifyusercontent.com/qXzZtknJjo6QB2qx3Mh2lXXqiQgGyTUO1W0h0hFk1ps/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vUWJLRU9ydzZQa0xjeTRYbXMvdmtta2U3QUZSMmh1TFlwSjctcGRmXzIwMjI5OC5wbmc.webp)
No credit card required
![PDF Text Extractor](https://images.apifyusercontent.com/qXzZtknJjo6QB2qx3Mh2lXXqiQgGyTUO1W0h0hFk1ps/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vUWJLRU9ydzZQa0xjeTRYbXMvdmtta2U3QUZSMmh1TFlwSjctcGRmXzIwMjI5OC5wbmc.webp)
PDF Text Extractor
No credit card required
PDF Text Extractor allows you to extract text from PDF files. It also supports chunking of the text to prepare the data for usage with large language models.
Extracting data process has ended with the issue in the beginning: Failed to load document (PDFium: Data format error)
Closed
2024-01-11T09:09:31.163Z ERROR Actor failed with an exception 2024-01-11T09:09:31.165Z Traceback (most recent call last): 2024-01-11T09:09:31.166Z File "/usr/src/app/src/main.py", line 14, in main 2024-01-11T09:09:31.167Z pdf_document = pdfium.PdfDocument(io.BytesIO(pdf.content)) 2024-01-11T09:09:31.167Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-01-11T09:09:31.167Z File "/usr/local/lib/python3.11/site-packages/pypdfium2/_helpers/document.py", line 77, in init 2024-01-11T09:09:31.168Z self.raw, to_hold, to_close = _open_pdf(self._input, self._password, self._autoclose) 2024-01-11T09:09:31.168Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-01-11T09:09:31.169Z File "/usr/local/lib/python3.11/site-packages/pypdfium2/_helpers/document.py", line 744, in _open_pdf 2024-01-11T09:09:31.169Z raise PdfiumError(f"Failed to load document (PDFium: {pdfium_i.ErrorToStr.get(err_code)}).") 2024-01-11T09:09:31.169Z pypdfium2._helpers.misc.PdfiumError: Failed to load document (PDFium: Data format error).
![jirimoravcik avatar](https://apify-image-uploads-prod.s3.amazonaws.com/fT657pWzfeMmDrxGp/ogdYRS8u2438hgEZ7-profile_pic.jpg)
Hello, I've updated the Actor, it should now tell you where the problem is and will continue working with files that are not problematic.
insomniac_boy
It helped, however, now it obviously skips a big chunk of files. By observing logs, I came to conclusion that this error may be caused by the encoding-related bug. I mean there are Cyrillic, Greek and Roman letters in these pdfs.
![jirimoravcik avatar](https://apify-image-uploads-prod.s3.amazonaws.com/fT657pWzfeMmDrxGp/ogdYRS8u2438hgEZ7-profile_pic.jpg)
Yeah, it's crashing in the underlying library, so there's not much I can do here. Sorry about that.
- 30 monthly users
- 14 stars
- 100.0% runs succeeded
- Created in Oct 2023
- Modified 4 months ago