We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example:
import fitz doc = fitz.open("demo.docx") pdfbytes = doc.convert_to_pdf() pdf = fitz.open("pdf", pdfbytes) pdf.save("some.pdf")
demo.docx
Result error:
Traceback (most recent call last): File "E:\dr\venv\Lib\site-packages\fitz\__init__.py", line 2659, in __init__ self.this = extra.Document_init( filename, stream, filetype, rect, width, height, fontsize) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\dr\venv\Lib\site-packages\fitz\extra.py", line 153, in Document_init return _extra.Document_init(filename, stream, filetype, rect, width, height, fontsize) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: code=2: cannot find fixed document sequence start part The above exception was the direct cause of the following exception: Traceback (most recent call last): File "E:\dr\html_to_pdf.py", line 3, in <module> doc = fitz.open("demo.docx") ^^^^^^^^^^^^^^^^^^^^^^ File "E:\dr\venv\Lib\site-packages\fitz\__init__.py", line 2666, in __init__ raise FileDataError( MSG_BAD_DOCUMENT) from e fitz.FileDataError: cannot open broken document
1.23.26
Linux
3.11
The text was updated successfully, but these errors were encountered:
.docx files are not supported. Please see: https://pymupdf.readthedocs.io/en/latest/how-to-open-a-file.html#supported-file-types
Sorry, something went wrong.
No branches or pull requests
Description of the bug
Example:
demo.docx
How to reproduce the bug
Result error:
PyMuPDF version
1.23.26
Operating system
Linux
Python version
3.11
The text was updated successfully, but these errors were encountered: