From 4a77284ca9d5c6d67bdc1e3bfb6c562798dda54e Mon Sep 17 00:00:00 2001 From: DemchaAV Date: Wed, 17 Jun 2026 11:04:10 +0100 Subject: [PATCH] fix(examples): crop the engine banner tight to its content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standalone engine-banner page used full A4-landscape on a 16pt margin and a 30pt panel pad, so the top-anchored logo→chips stack sat inside a thick dead dark border (and a slack band below the capability chips). Size the page to the content instead — 801x525 with an 8pt margin and an 18pt panel pad — so the width hugs the 749pt rules, the height wraps the stack in one page, and the rasterised hero is all signal with only a thin frame. --- .../demcha/examples/flagships/EngineDeckExample.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/src/main/java/com/demcha/examples/flagships/EngineDeckExample.java b/examples/src/main/java/com/demcha/examples/flagships/EngineDeckExample.java index 228cead12..48346b2a5 100644 --- a/examples/src/main/java/com/demcha/examples/flagships/EngineDeckExample.java +++ b/examples/src/main/java/com/demcha/examples/flagships/EngineDeckExample.java @@ -141,9 +141,14 @@ public static Path generate() throws Exception { public static Path generateBanner() throws Exception { Path outputFile = ExampleOutputPaths.prepare("flagships", "engine-banner.pdf"); try (DocumentSession document = GraphCompose.document(outputFile) - .pageSize(DocumentPageSize.A4.landscape()) + // The banner content is a top-anchored stack; the default + // A4-landscape page left a thick dead dark border around it. + // Crop the page to wrap the content tightly — width fits the + // 749pt rules plus a thin frame, height wraps the logo→chips + // stack — so the rasterised hero is all signal, no padding. + .pageSize(801, 525) .pageBackground(HERO_BG) - .margin(16, 16, 16, 16) + .margin(8, 8, 8, 8) .create()) { document.metadata(DocumentMetadata.builder() .title("GraphCompose v" + VERSION + " — " + CODENAME) @@ -306,7 +311,7 @@ static void compose(DocumentSession document) { // ───────────────────────────────────────────────────────────────────────── private static void banner(SectionBuilder s) { - s.softPanel(HERO_BG, 12, 30) + s.softPanel(HERO_BG, 12, 18) .spacing(16) // Logo + version badge on one line; tagline below. .add(brandLine())