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

Method embfile_info

src/__init__.py:4492–4512  ·  view source on GitHub ↗

Get information of an item in the EmbeddedFiles array. Args: item: number or name of item. Returns: Information dictionary.

(self, item: typing.Union[int, str])

Source from the content-addressed store, hash-verified

4490 return self._embeddedFileGet(idx)
4491
4492 def embfile_info(self, item: typing.Union[int, str]) -> dict:
4493 """Get information of an item in the EmbeddedFiles array.
4494
4495 Args:
4496 item: number or name of item.
4497 Returns:
4498 Information dictionary.
4499 """
4500 idx = self._embeddedFileIndex(item)
4501 infodict = {"name": self.embfile_names()[idx]}
4502 xref = self._embfile_info(idx, infodict)
4503 t, date = self.xref_get_key(xref, "Params/CreationDate")
4504 if t != "null":
4505 infodict["creationDate"] = date
4506 t, date = self.xref_get_key(xref, "Params/ModDate")
4507 if t != "null":
4508 infodict["modDate"] = date
4509 t, md5 = self.xref_get_key(xref, "Params/CheckSum")
4510 if t != "null":
4511 infodict["checksum"] = binascii.hexlify(md5.encode()).decode()
4512 return infodict
4513
4514 def embfile_names(self) -> list:
4515 """Get list of names of EmbeddedFiles."""

Callers 10

embedded_copyFunction · 0.80
embedded_getFunction · 0.80
embedded_updFunction · 0.80
embedded_listFunction · 0.80
embedded_copyFunction · 0.80
embedded_getFunction · 0.80
embedded_updFunction · 0.80
embedded_listFunction · 0.80
test_embedded1Function · 0.80
test_4050Function · 0.80

Calls 4

_embeddedFileIndexMethod · 0.95
embfile_namesMethod · 0.95
_embfile_infoMethod · 0.95
xref_get_keyMethod · 0.95

Tested by 2

test_embedded1Function · 0.64
test_4050Function · 0.64