pdfgen.translator module

pdfgen.translator.FOOTER = '###Page###/###Total###'
pdfgen.translator.gen_pdf(rst_content, style_text, header=None, footer='###Page###/###Total###')[source]

Create PDF file from rst_content using style_text as style.

Optinally, add header or footer.

Parameters:
  • rst_content (str) – Content of the PDF file in restructured text markup.
  • style_text (str) – Style for the rst2pdf module.
  • header (str, default None) – Header which will be rendered to each page.
  • footer (str, default FOOTER) – Footer, which will be rendered to each page. See FOOTER for details.
Returns:

StringIO file instance containing PDF file.

Return type:

obj