MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / journal_load

Method journal_load

src/__init__.py:5607–5619  ·  view source on GitHub ↗

Load a journal from a file.

(self, filename)

Source from the content-addressed store, hash-verified

5605 return enabled
5606
5607 def journal_load(self, filename):
5608 """Load a journal from a file."""
5609 if self.is_closed or self.is_encrypted:
5610 raise ValueError("document closed or encrypted")
5611 pdf = _as_pdf_document(self)
5612 if isinstance(filename, str):
5613 mupdf.pdf_load_journal(pdf, filename)
5614 else:
5615 res = JM_BufferFromBytes(filename)
5616 stm = mupdf.fz_open_buffer(res)
5617 mupdf.pdf_deserialise_journal(pdf, stm)
5618 if not pdf.m_internal.journal:
5619 RAISEPY( "Journal and document do not match", JM_Exc_FileDataError)
5620
5621 def journal_op_name(self, step):
5622 """Show operation name for given step."""

Callers

nothing calls this directly

Calls 3

_as_pdf_documentFunction · 0.85
JM_BufferFromBytesFunction · 0.85
RAISEPYFunction · 0.85

Tested by

no test coverage detected