MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / commit

Method commit

src_classic/utils.py:4029–4047  ·  view source on GitHub ↗

Update the page's /Contents object with Shape data. The argument controls whether data appear in foreground (default) or background.

(self, overlay: bool = True)

Source from the content-addressed store, hash-verified

4027 return
4028
4029 def commit(self, overlay: bool = True) -> None:
4030 """Update the page's /Contents object with Shape data. The argument controls whether data appear in foreground (default) or background."""
4031 CheckParent(self.page) # doc may have died meanwhile
4032 self.totalcont += self.text_cont
4033
4034 self.totalcont = self.totalcont.encode()
4035
4036 if self.totalcont != b"":
4037 # make /Contents object with dummy stream
4038 xref = TOOLS._insert_contents(self.page, b" ", overlay)
4039 # update it with potential compression
4040 self.doc.update_stream(xref, self.totalcont)
4041
4042 self.lastPoint = None # clean up ...
4043 self.rect = None #
4044 self.draw_cont = "" # for potential ...
4045 self.text_cont = "" # ...
4046 self.totalcont = "" # re-use
4047 return
4048
4049
4050def apply_redactions(page: Page, images: int = 2) -> bool:

Callers 14

insert_textboxFunction · 0.45
insert_textFunction · 0.45
draw_lineFunction · 0.45
draw_squiggleFunction · 0.45
draw_zigzagFunction · 0.45
draw_rectFunction · 0.45
draw_quadFunction · 0.45
draw_polylineFunction · 0.45
draw_circleFunction · 0.45
draw_ovalFunction · 0.45
draw_curveFunction · 0.45
draw_bezierFunction · 0.45

Calls 3

CheckParentFunction · 0.85
_insert_contentsMethod · 0.80
update_streamMethod · 0.80

Tested by

no test coverage detected