Problem/Motivation

The printable ticket PDF is assembled in PHP by TicketBuilder::document(): it wraps the rendered ticket bodies in a full HTML document (doctype, head, an embedded stylesheet, body) with a page break between tickets. The ticket body itself is already a Twig template (the yoyaku_ticket theme hook), but the surrounding page and its print CSS are hand-built strings, so a site cannot restructure the printed page or restyle it without patching the module.

Proposed resolution

Add a theme hook (for example yoyaku_ticket_document) backed by a Twig template that renders the page wrapper and embeds the print styles, and route document() through the renderer. Keep the styles embedded rather than in a library, since the PDF renderer (dompdf) ignores an external stylesheet, the same reason the mail summary template carries its styles inline.

Remaining tasks

  • Add the theme hook and default template.
  • Route the document assembly through the renderer, keeping the page break between tickets.
  • Update tests and documentation.

Issue fork yoyaku-3613189

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed 62428908 on 1.x
    feat: #3613189 Render the PDF ticket document through a theme template...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.