查看报告 PDF 从同一语义模型导出
var fonts = FontGroup.builder()
.fontFile("fonts/regular.ttf")
.build();
var engine = DocumentEngine.builder(fonts).build();
var document = Document.builder()
.heading("Quarterly report", 1)
.paragraph("A report with automatic pagination.")
.table(List.of("Metric", "Value"),
List.of(List.of("Revenue", "120")))
.build();
engine.write(document, new PdfBackend(), "report.pdf");显式提供授权字体。完整示例包含依赖与 import。
以下样张由 Export4j 生成,可打开 PDF 检查真实输出。
Java 21 · Apache-2.0 · 无需 Office 或浏览器进程
当前为候选版本,API 仍可能调整。 RC2 发布说明