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

Method _remove_toc_item

src/__init__.py:4062–4071  ·  view source on GitHub ↗
(self, xref)

Source from the content-addressed store, hash-verified

4060 _remove_dest_range(pdf, numbers)
4061
4062 def _remove_toc_item(self, xref):
4063 # "remove" bookmark by letting it point to nowhere
4064 pdf = _as_pdf_document(self)
4065 item = mupdf.pdf_new_indirect(pdf, xref, 0)
4066 mupdf.pdf_dict_del( item, PDF_NAME('Dest'))
4067 mupdf.pdf_dict_del( item, PDF_NAME('A'))
4068 color = mupdf.pdf_new_array( pdf, 3)
4069 for i in range(3):
4070 mupdf.pdf_array_push_real( color, 0.8)
4071 mupdf.pdf_dict_put( item, PDF_NAME('C'), color)
4072
4073 def _reset_page_refs(self):
4074 """Invalidate all pages in document dictionary."""

Callers 3

del_toc_itemMethod · 0.95
delete_pagesMethod · 0.95
del_toc_itemFunction · 0.80

Calls 2

_as_pdf_documentFunction · 0.85
PDF_NAMEFunction · 0.85

Tested by

no test coverage detected