MCPcopy Create free account
hub / github.com/ipython/ipython / PDFFormatter

Class PDFFormatter

IPython/core/formatters.py:864–879  ·  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

862
863
864class PDFFormatter(BaseFormatter):
865 """A PDF formatter.
866
867 To define the callables that compute the PDF representation of your
868 objects, define a :meth:`_repr_pdf_` method or use the :meth:`for_type`
869 or :meth:`for_type_by_name` methods to register functions that handle
870 this.
871
872 The return value of this formatter should be raw PDF data, *not*
873 base64 encoded.
874 """
875 format_type = Unicode('application/pdf')
876
877 print_method = ObjectName('_repr_pdf_')
878
879 _return_type = (bytes, str)
880
881class IPythonDisplayFormatter(BaseFormatter):
882 """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