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

Function embedded_del

src_classic/__main__.py:330–346  ·  view source on GitHub ↗

Delete an embedded file entry.

(args)

Source from the content-addressed store, hash-verified

328
329
330def embedded_del(args):
331 """Delete an embedded file entry."""
332 doc = open_file(args.input, args.password, pdf=True)
333 if not doc.can_save_incrementally() and (
334 not args.output or args.output == args.input
335 ):
336 sys.exit("cannot save PDF incrementally")
337
338 try:
339 doc.embfile_del(args.name)
340 except ValueError:
341 sys.exit("no such embedded file '%s'" % args.name)
342 if not args.output or args.output == args.input:
343 doc.save_incr()
344 else:
345 doc.save(args.output, garbage=1)
346 doc.close()
347
348
349def embedded_get(args):

Callers

nothing calls this directly

Calls 5

embfile_delMethod · 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…