Modern Proposal
The ModernProposal preset composed straight from its document spec — cover, scope sections and pricing table themed through BrandTheme.
1 page
Use this template
<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>
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.proposal.presets.ModernProposal
Data model com.demcha.compose.document.templates.data.proposal.ProposalDocumentSpec
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();
}
./mvnw -f examples/pom.xml exec:java -Dexec.mainClass=com.demcha.examples.templates.proposal.v2.ModernProposalV2Example
Writes examples/target/generated-pdfs/templates/proposal/proposal-modern-v2.pdf