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

Method add_text

src/__init__.py:2321–2333  ·  view source on GitHub ↗

Add text. Line breaks are honored.

(self, text)

Source from the content-addressed store, hash-verified

2319 return self
2320
2321 def add_text(self, text):
2322 """Add text. Line breaks are honored."""
2323 lines = text.splitlines()
2324 line_count = len(lines)
2325 prev = self.span_bottom()
2326 if prev is None:
2327 prev = self
2328
2329 for i, line in enumerate(lines):
2330 prev.append_child(self.create_text_node(line))
2331 if i < line_count - 1:
2332 prev.append_child(self.create_element("br"))
2333 return self
2334
2335 def append_child( self, child):
2336 mupdf.fz_dom_append_child( self.this, child.this)

Callers 9

header_storyFunction · 0.80
footer_storyFunction · 0.80
code_printerFunction · 0.80
code-printer.pyFile · 0.80
json-example.pyFile · 0.80
table01.pyFile · 0.80
simple-grid.pyFile · 0.80

Calls 4

span_bottomMethod · 0.95
create_text_nodeMethod · 0.95
create_elementMethod · 0.95
append_childMethod · 0.80

Tested by

no test coverage detected