Build

code_to_pdf.build(source_code: str, filename: str | None = None, *, options: Options) bytes

Build PDF with source_code.

Parameters:
  • source_code – Code to build the PDF from.

  • filename – Source file name (used for Pygments lexer lookup, optional).

  • options – Document generation options.

Returns:

Byte array with the contents of the generated PDF file.