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

Function embedded_del

src/__main__.py:328–344  ·  view source on GitHub ↗

Delete an embedded file entry.

(args)

Source from the content-addressed store, hash-verified

326
327
328def embedded_del(args):
329 """Delete an embedded file entry."""
330 doc = open_file(args.input, args.password, pdf=True)
331 if not doc.can_save_incrementally() and (
332 not args.output or args.output == args.input
333 ):
334 sys.exit("cannot save PDF incrementally")
335
336 try:
337 doc.embfile_del(args.name)
338 except (ValueError, pymupdf.mupdf.FzErrorBase) as e:
339 sys.exit(f'no such embedded file {args.name!r}: {e}')
340 if not args.output or args.output == args.input:
341 doc.saveIncr()
342 else:
343 doc.save(args.output, garbage=1)
344 doc.close()
345
346
347def embedded_get(args):

Callers

nothing calls this directly

Calls 6

embfile_delMethod · 0.80
saveIncrMethod · 0.80
open_fileFunction · 0.70
saveMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…