Project Proposal (cinematic)

End-to-end project proposal with mountain hero, scope panels, and pricing summary.

1 page

Run this example

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

Java 17 or newer

From the docs
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.proposal.ProposalDocumentSpec;
import com.demcha.compose.document.templates.proposal.presets.ModernProposal;

import java.nio.file.Path;

ProposalDocumentSpec proposal = ProposalDocumentSpec.builder()
        .title("Proposal")
        .proposalNumber("PR-2026-014")
        .preparedDate("25 Jun 2026")
        .validUntil("25 Jul 2026")
        .projectTitle("Document Automation Platform")
        .executiveSummary("A proposal for building reliable PDF generation into the product workflow.")
        .sender(party -> party
                .name("GraphCompose Studio")
                .addressLines("10 Example Street", "London")
                .email("hello@example.com")
                .website("graphcompose.example"))
        .recipient(party -> party
                .name("Client Ltd")
                .addressLines("22 Client Road", "Manchester")
                .email("product@client.example"))
        .section("Scope", "Backend integration, template setup, and regression checks.")
        .timelineItem("Week 1", "1 week", "Data model and rendering endpoint.")
        .pricingRow("Implementation", "Fixed scope", "4,800.00")
        .emphasizedPricingRow("Total", "Excluding tax", "4,800.00")
        .acceptanceTerm("Proposal valid for 30 days.")
        .footerNote("Prepared with GraphCompose.")
        .build();

BrandTheme theme = BrandTheme.proposalModern();
DocumentTemplate<ProposalDocumentSpec> template = ModernProposal.create(theme);

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

Writes examples/target/generated-pdfs/templates/proposal/project-proposal-cinematic.pdf