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

Method commit

src/__init__.py:15797–15819  ·  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

15795 return
15796
15797 def commit(self, overlay: bool = True) -> None:
15798 """Update the page's /Contents object with Shape data.
15799
15800 The argument controls whether data appear in foreground (default)
15801 or background.
15802 """
15803 CheckParent(self.page) # doc may have died meanwhile
15804 self.totalcont += self.text_cont
15805 self.totalcont = self.totalcont.encode()
15806
15807 if self.totalcont:
15808 if overlay:
15809 self.page.wrap_contents() # ensure a balanced graphics state
15810 # make /Contents object with dummy stream
15811 xref = TOOLS._insert_contents(self.page, b" ", overlay)
15812 # update it with potential compression
15813 self.doc.update_stream(xref, self.totalcont)
15814
15815 self.last_point = None # clean up ...
15816 self.rect = None #
15817 self.draw_cont = "" # for potential ...
15818 self.text_cont = "" # ...
15819 self.totalcont = "" # re-use
15820
15821
15822class Story:

Callers 15

apply_redactionsMethod · 0.45
draw_bezierMethod · 0.45
draw_circleMethod · 0.45
draw_curveMethod · 0.45
draw_lineMethod · 0.45
draw_ovalMethod · 0.45
draw_polylineMethod · 0.45
draw_quadMethod · 0.45
draw_rectMethod · 0.45
draw_sectorMethod · 0.45
draw_squiggleMethod · 0.45
draw_zigzagMethod · 0.45

Calls 4

CheckParentFunction · 0.85
wrap_contentsMethod · 0.80
_insert_contentsMethod · 0.80
update_streamMethod · 0.80

Tested by 2

test_drawings3Function · 0.36
test_3140Function · 0.36