03PWEImplemented

Promotional materials generator

A PHP GD generator that compiles a complete set of promotional graphics in Polish and English for each edition of the trade fair with a single click — even if the dates have been rescheduled.

My role
Design and implementation of the generator, and integration with the internal application dashboard
Context
PWE · PWE System
Technologies
PHP · PHP GD · WordPress · API
4graphics per editionPL/EN × 1200×200 and 800×800
15–30 minsmanually per setestimate prior to implementation
1clickgeneration and regeneration

In a nutshell

  1. Problem

    For each edition of the fair, the graphic designers produced four designs: two language versions in two sizes. Typesetting the entire set by hand took an estimated 15–30 minutes and was repeated even after the event had been rescheduled.

  2. Solution

    The generator combines ready-made graphics – including the background, the event logo, the organiser’s logo, dates and text – into a single image. It renders the image at a higher resolution and downscales the result to improve smoothing, ensures the dimensions and format are correct, and restores the previous files in the event of an error.

  3. Outcome

    No more manually typesetting four graphics for every edition and every date change. Staff no longer have to wait for the layout to be ready — the content is generated automatically according to a pre-defined template.

Pre-launch process

For each new edition of the event, the design team would manually prepare a set of four promotional files. The same set had to be redone whenever the fair’s dates were rescheduled, as the dates form an integral part of the graphics.

This usually took 15–30 minutes per set (my estimate) — on top of which came the task of assigning the job to a graphic designer and waiting for the result. The difficulty lay not in a single graphic, but in the repetitive nature of the task: the files had the same structure and differed only in the predictable event details. This is a perfect case for automated typesetting.

Result of a single cycle

  • 1200×200 banner — Polish.
  • 1200×200 banner — English.
  • 800×800 graphic — Polish.
  • 800×800 graphic — English.

From an employee’s perspective

A complete set of materials is generated or regenerated at the touch of a button. The system retrieves the latest event data — dates, descriptions in the relevant language, local graphics and logos — and compiles the finished images according to four templates. When a date changes, there’s no need to ask a graphic designer to open the design files.

Automation eliminates repetitive layout work, but does not replace design: for exceptionally long event names or marketing texts, it is still worth reviewing the result.

Data and templates

The module has a separate configuration, graphics engine and four template definitions — the layout can be changed without having to rebuild the entire process.

  • Dates and descriptions in both languages come from the same event data the website uses — a single source of truth.
  • Texts are stripped of HTML tags, whitespace is normalised, and the date is checked for validity.
  • The event description can be automatically split into two lines; capitalisation takes UTF-8 (Polish characters) into account.
  • A shared canvas layer places images (using the contain or cover rules), text and simple shapes; each template specifies only the dimensions, language and required assets.

Technical implementation

The WordPress module utilises PHP GD and layout templates. The rendering logic is separated from the template definitions, and generation can be triggered or re-run from the internal application dashboard.

  • A lock flock() against the concurrent generation of the same content.
  • Temporary files are retained until the production output is overwritten.
  • Copies of previous graphics and rollback in the event of an error.
  • Control over the dimensions and format of output files.

Rendering quality

The engine uses PHP GD and FreeType: it loads local PNG, WebP and JPEG files, and typesets text using TTF/OTF fonts. Graphics are rendered at three times the working scale and only then reduced to 1200 × 200 or 800 × 800 px — this ensures that the edges of letters and shapes are smooth without the need for external graphics software.

Before rendering, the generator checks for the presence and readability of assets and the validity of fonts, limits the size and resolution of source files, and rejects suspicious paths. Errors are accompanied by a clear description of the cause, whilst the stored date of the last generation allows you to skip unnecessary repetitions.

Result

Manual typesetting of four variants is replaced by a single click, and once the date is changed, the entire set can be reproduced immediately. Graphic designers focus on tasks requiring design work, and updating materials does not depend on whether a team member is currently available.

Annual savings depend on the number of events, rescheduling and the time taken for checks. As a guide: every 10 sets mean 2.5–5 hours less manual typesetting — this is a hypothetical scenario, not a measured result.