-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathBusinessReportPptxExample.java
More file actions
48 lines (42 loc) · 1.66 KB
/
Copy pathBusinessReportPptxExample.java
File metadata and controls
48 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.demcha.examples.flagships;
import com.demcha.compose.document.api.DocumentSession;
import com.demcha.examples.support.ExampleOutputPaths;
import java.nio.file.Path;
/**
* The {@link BusinessReportExample} investor report emitted as a PowerPoint
* deck: the same composition, built once through the shared session config and
* written through the fixed-layout PPTX backend via
* {@link DocumentSession#buildPptx(java.nio.file.Path)}. One resolved page becomes one
* identically-sized slide, so the report opens in PowerPoint as an editable copy
* of the PDF — the KPI cards, the native revenue/profit chart, and the metrics
* table arrive as editable shapes and text frames, not a screenshot.
*
* @since 2.1.0
*/
public final class BusinessReportPptxExample {
private BusinessReportPptxExample() {
}
/**
* Builds the investor report as the .pptx twin of {@link BusinessReportExample}.
*
* @return the generated file path
* @throws Exception when composition or rendering fails
*/
public static Path generate() throws Exception {
Path outputFile = ExampleOutputPaths.prepare("flagships", "business-report.pptx");
try (DocumentSession document = BusinessReportExample.document(outputFile).create()) {
BusinessReportExample.compose(document);
document.buildPptx(outputFile);
}
return outputFile;
}
/**
* Generates the deck from the command line.
*
* @param args unused
* @throws Exception when rendering fails
*/
public static void main(String[] args) throws Exception {
System.out.println("Generated: " + generate());
}
}