election_day.pdf

Classes

Pdf

Our custom PDF class.

Module Contents

class election_day.pdf.Pdf(*args: Any, locale: str | None = None, translations: dict[str, gettext.GNUTranslations] | None = None, toc_levels: int = 3, created: str = '', logo: str | None = None, link_color: str | None = None, underline_links: bool = False, underline_width: float | str = 0.5, **kwargs: Any)[source]

Bases: onegov.pdf.Pdf

Our custom PDF class.

This adds some custom styles, two tables (factoids, tables) and the ability to translate texts.

adjust_style(font_size: int = 10) None[source]

Adds styles for votes and elections.

translate(text: str) str[source]

Translates the given string.

h1(title: str, style: ParagraphStyle | None = None) None[source]

Translated H1.

h2(title: str, style: ParagraphStyle | None = None) None[source]

Translated H2.

h3(title: str, style: ParagraphStyle | None = None) None[source]

Translated H3.

figcaption(text: str, style: ParagraphStyle | None = None) None[source]

Translated Figcaption.

dates_line(date: Pdf.dates_line.date, changed: datetime | None) None[source]

Adds the given date and timespamp.

factoids(headers: list[str], values: list[str]) None[source]

Adds a table with factoids.

results(head: list[str], body: list[list[Any]], foot: list[Any] | None = None, hide: list[bool] | None = None) None[source]

Adds a table with results.