Cinematic Invoice

Layered ModernInvoice preset with theme-driven layout, advanced tables, and totals.

1 page

Use this template

Maven
<dependency>
  <groupId>io.github.demchaav</groupId>
  <artifactId>graph-compose</artifactId>
  <version>2.4.1</version>
</dependency>
<dependency>
  <groupId>io.github.demchaav</groupId>
  <artifactId>graph-compose-templates</artifactId>
  <version>2.4.1</version>
</dependency>
Gradle
implementation 'io.github.demchaav:graph-compose:2.4.1'
implementation 'io.github.demchaav:graph-compose-templates:2.4.1'

Java 17 or newer

Preset com.demcha.compose.document.templates.invoice.presets.ModernInvoice

Data model com.demcha.compose.document.templates.data.invoice.InvoiceDocumentSpec

Compose it
import com.demcha.compose.GraphCompose;
import com.demcha.compose.document.api.DocumentPageSize;
import com.demcha.compose.document.api.DocumentSession;
import com.demcha.compose.document.templates.api.DocumentTemplate;
import com.demcha.compose.document.templates.core.theme.BrandTheme;
import com.demcha.compose.document.templates.data.invoice.InvoiceDocumentSpec;
import com.demcha.compose.document.templates.invoice.presets.ModernInvoice;

import java.nio.file.Path;

InvoiceDocumentSpec invoice = InvoiceDocumentSpec.builder()
        .title("Invoice")
        .invoiceNumber("GC-2026-041")
        .issueDate("25 Jun 2026")
        .dueDate("25 Jul 2026")
        .reference("GraphCompose implementation")
        .status("Due")
        .fromParty(party -> party
                .name("GraphCompose Studio")
                .addressLines("10 Example Street", "London")
                .email("billing@example.com")
                .phone("+44 20 0000 0000")
                .taxId("VAT GB000000000"))
        .billToParty(party -> party
                .name("Client Ltd")
                .addressLines("22 Client Road", "Manchester")
                .email("accounts@client.example"))
        .lineItem("Document engine integration", "Implementation and support",
                "1", "4,800.00", "4,800.00")
        .summaryRow("Subtotal", "4,800.00")
        .summaryRow("VAT", "960.00")
        .totalRow("Total", "5,760.00")
        .paymentTerm("Payment due within 30 days.")
        .footerNote("Thank you for your business.")
        .build();

BrandTheme theme = BrandTheme.invoiceModern();
DocumentTemplate<InvoiceDocumentSpec> template = ModernInvoice.create(theme);

float margin = (float) ModernInvoice.RECOMMENDED_MARGIN;
try (DocumentSession document = GraphCompose.document(Path.of("invoice.pdf"))
        .pageSize(DocumentPageSize.A4)
        .pageBackground(theme.palette().mainFill())
        .margin(margin, margin, margin, margin)
        .create()) {
    template.compose(document, invoice);
    document.buildPdf();
}
Run the example
./mvnw -f examples/pom.xml exec:java -Dexec.mainClass=com.demcha.examples.templates.invoice.InvoiceCinematicFileExample

Writes examples/target/generated-pdfs/templates/invoice/invoice-cinematic.pdf