org.pdf.ticket

Classes

TicketQrCode

Generates QR Codes

TicketPdf

A PDF document.

Module Contents

class org.pdf.ticket.TicketQrCode(payload: str | bytes, border: int | None = None, box_size: int | None = None, fill_color: str | None = None, back_color: str | None = None, img_format: str | None = None, encoding: Literal['base64'] | None = None)[source]

Bases: onegov.qrcode.QrCode

Generates QR Codes

_border = 0[source]
class org.pdf.ticket.TicketPdf(*args: Any, **kwargs: Any)[source]

Bases: onegov.pdf.Pdf

A PDF document.

translate(text: str) str[source]

Translates the given string.

h1(title: str) None[source]

Translated H1.

h2(title: str) None[source]

Translated H2.

h3(title: str) None[source]

Translated H3.

property page_fn: Callable[[Canvas, Template], None][source]

First page the same as later except Qr-Code …

property page_fn_later: Callable[[Canvas, Template], None][source]
table(data: Sequence[Sequence[str | Paragraph]], columns: Literal['even'] | Sequence[float | None] | None, style: TableStyle | Iterable[_TableCommand] | None = None, ratios: Literal[False] = False, border: bool = True, first_bold: bool = True) None[source]
table(data: Sequence[Sequence[str | Paragraph]], columns: Literal['even'] | list[float] | None, style: TableStyle | Iterable[_TableCommand] | None = None, *, ratios: Literal[True], border: bool = True, first_bold: bool = True) None
table(data: Sequence[Sequence[str | Paragraph]], columns: Literal['even'] | list[float] | None, style: TableStyle | Iterable[_TableCommand] | None, ratios: Literal[True], border: bool = True, first_bold: bool = True) None
table(data: Sequence[Sequence[str | Paragraph]], columns: Literal['even'] | Sequence[float | None] | None, style: TableStyle | Iterable[_TableCommand] | None = None, ratios: bool = False, border: bool = True, first_bold: bool = True) None

Adds a table where every cell is wrapped in a paragraph so that the cells are wrappable.

ticket_summary(html: str | None, linkify: bool = True) None[source]

A copy of the mini_html adapted for ticket summary. We have to guarantee some backwards compatibility here whenever we change the templates and thereby the snapshot of tickets.

Must work for templates: - directory_entry_submission - display_event - display_form - reservations

ticket_metadata() None[source]
ticket_payment() None[source]
p_markup(text: str, style: ParagraphStyle | None = None) None[source]
ticket_timeline(msg_feed: Mapping[str, Any] | None) None[source]

Will parse the timeline from view_messages_feed

static extract_feed_info(html: str) list[str | None] | None[source]

Must be able to parse templates message_{message.type}.pt and return the useful data in cleaned form.

classmethod from_ticket(request: onegov.org.request.OrgRequest, ticket: onegov.ticket.Ticket) io.BytesIO[source]

Creates a PDF representation of the ticket. It is sensible to the templates used to render the message feed and the summary of the ticket coming from ticket handler. With this approach, snapshotted summaries are supported.