MCPcopy Index your code
hub / github.com/ipython/ipython / PDFFormatter

Class PDFFormatter

IPython/core/formatters.py:930–945  ·  view source on GitHub ↗

A PDF formatter. To define the callables that compute the PDF representation of your objects, define a :meth:`_repr_pdf_` method or use the :meth:`for_type` or :meth:`for_type_by_name` methods to register functions that handle this. The return value of this formatter should be

Source from the content-addressed store, hash-verified

928
929
930class PDFFormatter(BaseFormatter):
931 """A PDF formatter.
932
933 To define the callables that compute the PDF representation of your
934 objects, define a :meth:`_repr_pdf_` method or use the :meth:`for_type`
935 or :meth:`for_type_by_name` methods to register functions that handle
936 this.
937
938 The return value of this formatter should be raw PDF data, *not*
939 base64 encoded.
940 """
941 format_type = Unicode('application/pdf')
942
943 print_method = ObjectName('_repr_pdf_')
944
945 _return_type = (bytes, str)
946
947class IPythonDisplayFormatter(BaseFormatter):
948 """An escape-hatch Formatter for objects that know how to display themselves.

Callers 1

test_pdf_formatterFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_pdf_formatterFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…