You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to apply the linearization to a document while use the write()method generates the error "RuntimeError: cannot seek in buffer: No such file or directory". This does not happen when using the save() method.
To Reproduce
import fitz
doc = fitz.open(pdf_path)
# Works:
doc.save("linearized.pdf",garbage=0, deflate=False,linear=True)
# Returns error: "RuntimeError: cannot seek in buffer: No such file or directory"
linearized_pdf_bytes = doc.write(garbage=0, deflate=False,linear=True)
Expected behavior
The method should return the bytes of the linearized PDF data.
Sorry, there is no way to heal this, because it's done by the underlying C library MuPDF.
You must save to disk and re-read the result.
I will update the documentation accordingly.
Sorry, there is no way to heal this, because it's done by the underlying C library MuPDF.
You must save to disk and re-read the result.
I will update the documentation accordingly.
Maybe this has changed in the meanwhile. The function pdf_write_document() is calling do_pdf_save_document() which considers the linear option. pdf_save_document() is also calling do_pdf_save_document().
Describe the bug
When attempting to apply the linearization to a document while use the
write()
method generates the error "RuntimeError: cannot seek in buffer: No such file or directory". This does not happen when using thesave()
method.To Reproduce
Expected behavior
The method should return the bytes of the linearized PDF data.
Your configuration (mandatory)
3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
PyMuPDF 1.17.7: Python bindings for the MuPDF 1.17.0 library.
Version date: 2020-09-14 06:33:06.
Built for Python 3.8 on Liinux (64-bit).
The text was updated successfully, but these errors were encountered: