Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load document (PDFium: File access error). #421

Open
Anais1778 opened this issue Dec 12, 2024 · 10 comments
Open

Failed to load document (PDFium: File access error). #421

Anais1778 opened this issue Dec 12, 2024 · 10 comments

Comments

@Anais1778
Copy link

Windows 11
python 3.11

I encountered the following error while using the marker package to process a PDF file.
I successed in open marker_gui,but can not run Marker in marker_app.
It shows:

pypdfium2._helpers.misc.PdfiumError: Failed to load document (PDFium: File access error).
Traceback:
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\marker_app.py", line 136, in
rendered = convert_pdf(
^^^^^^^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\marker_app.py", line 37, in convert_pdf
return converter(fname)
^^^^^^^^^^^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\marker\converters\pdf.py", line 101, in call
pdf_provider = PdfProvider(filepath, self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\marker\providers\pdf.py", line 32, in init
self.doc: pdfium.PdfDocument = pdfium.PdfDocument(self.filepath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\pypdfium2_helpers\document.py", line 78, in init
self.raw, to_hold, to_close = _open_pdf(self._input, self._password, self._autoclose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TJY\AppData\Roaming\Python\Python311\site-packages\pypdfium2_helpers\document.py", line 678, in _open_pdf
raise PdfiumError(f"Failed to load document (PDFium: {pdfium_i.ErrorToStr.get(err_code)}).")

@protorob
Copy link

Having the same issue on windows :(

@lovitus
Copy link

lovitus commented Dec 17, 2024

same here

4 similar comments
@mikailcetinkaya
Copy link

same here

@prettybot
Copy link

same here

@10179013
Copy link

same here

@altzh666
Copy link

altzh666 commented Jan 3, 2025

same here

@gt732
Copy link

gt732 commented Jan 3, 2025

same any solution??

@edwardsun
Copy link

edwardsun commented Jan 5, 2025

+1 same issue on mac m4
image

@JaydencoolCC
Copy link

Same in Linux any solution?

@Eisen59
Copy link

Eisen59 commented Jan 11, 2025

same issue for me in marker_gui

`pypdfium2._helpers.misc.PdfiumError: Failed to load document (PDFium: File access error).
Traceback:

File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker_app.py", line 140, in
rendered = convert_pdf(
^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker_app.py", line 37, in convert_pdf
return converter(fname)
^^^^^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker\converters\pdf.py", line 130, in call
document = self.build_document(filepath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker\converters\pdf.py", line 117, in build_document
pdf_provider = PdfProvider(filepath, self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\marker\providers\pdf.py", line 36, in init
self.doc: pdfium.PdfDocument = pdfium.PdfDocument(self.filepath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdfium2_helpers\document.py", line 78, in init
self.raw, to_hold, to_close = _open_pdf(self._input, self._password, self._autoclose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Felix\AppData\Local\Programs\Python\Python312\Lib\site-packages\pypdfium2_helpers\document.py", line 678, in _open_pdf
raise PdfiumError(f"Failed to load document (PDFium: #{pdfium_i.ErrorToStr.get(err_code)}).")`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests