Options

class code_to_pdf.Options(*, style: str = 'default', font_size: Literal['10pt', '11pt', '12pt'] = '10pt', linenos: bool = False, linenostep: int = 0, page_numbers: bool = False, paper: str | None = None, paper_width: str | None = None, paper_height: str | None = None, top_margin: str = '0.4in', bottom_margin: str = '0.4in', left_margin: str = '0.5in', right_margin: str = '0.5in')

Options for document generation.

style

Pygments style (see https://pygments.org/styles/).

Type:

str

font_size

Document font size.

Type:

Literal[‘10pt’, ‘11pt’, ‘12pt’]

linenos

Whether or not to display line numbers.

Type:

bool

linenostep

If linenos is enabled, print every n-th line number.

Type:

int

page_numbers

Whether or not to print page numbers.

Type:

bool

paper

Paper format of resulting document (paper_width and paper_height, when provided, both take precedence over paper).

Type:

str | None

paper_width

Paper width of resulting document.

Type:

str | None

paper_height

Paper height of resulting document.

Type:

str | None

top_margin

Document top margin.

Type:

str

bottom_margin

Document bottom margin.

Type:

str

left_margin

Document left margin.

Type:

str

right_margin

Document right margin.

Type:

str