MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / finalize

Method finalize

lib/matplotlib/backends/backend_pdf.py:820–849  ·  view source on GitHub ↗

Write out the various deferred objects and the pdf end matter.

(self)

Source from the content-addressed store, hash-verified

818 return PdfFile._get_subset_prefix(frozenset(charmap.values())) + ps_name
819
820 def finalize(self):
821 """Write out the various deferred objects and the pdf end matter."""
822
823 self.endStream()
824 self._write_annotations()
825 self.writeFonts()
826 self.writeExtGSTates()
827 self._write_soft_mask_groups()
828 self.writeHatches()
829 self.writeGouraudTriangles()
830 xobjects = {
831 name: ob for image, name, ob in self._images.values()}
832 for tup in self.markers.values():
833 xobjects[tup[0]] = tup[1]
834 for name, path, trans, ob, join, cap, padding, filled, stroked \
835 in self.paths:
836 xobjects[name] = ob
837 self.writeObject(self.XObjectObject, xobjects)
838 self.writeImages()
839 self.writeMarkers()
840 self.writePathCollectionTemplates()
841 self.writeObject(self.pagesObject,
842 {'Type': Name('Pages'),
843 'Kids': self.pageList,
844 'Count': len(self.pageList)})
845 self.writeInfoDict()
846
847 # Finalize the file
848 self.writeXref()
849 self.writeTrailer()
850
851 def close(self):
852 """Flush all buffers and free all resources."""

Callers 7

print_pdfMethod · 0.95
_save_blit_backgroundMethod · 0.45
__init__Method · 0.45
_setup_latex_processMethod · 0.45
finalizeMethod · 0.45
closeMethod · 0.45
__call__Method · 0.45

Calls 15

endStreamMethod · 0.95
_write_annotationsMethod · 0.95
writeFontsMethod · 0.95
writeExtGSTatesMethod · 0.95
writeHatchesMethod · 0.95
writeGouraudTrianglesMethod · 0.95
writeObjectMethod · 0.95
writeImagesMethod · 0.95
writeMarkersMethod · 0.95
writeInfoDictMethod · 0.95

Tested by

no test coverage detected