Docx, xlsx template engine and pdf converter to provide enterprise document generation capabilities
Docx, xlsx template engine and pdf converter to provide enterprise document generation feautures.
The module is a Helm package with a REST API to generate documents from WYSIWYG templates, or template structures with JSON actual data via jsonpath and SpEL expression-like placeholders. The engine core is a java wrapper to other tools integrate their capabilities and can be used with typed DTO-s as a dependency also.
Note:
This project is in incubation phase. Hold on, we will deploy it on Maven Central and ghcr.io as soon as we can.
If you find the functionality covered by the engine useful, please give it a star.
Inputs:
Output:
Uses:
To create a simple document
public OutputStream generateContractDocument() {
MyDTO dto = generateData();
return TemplateServiceRegistry.getInstance().fill("MyTemplate.docx", dto, OutputFormat.PDF);
}
# contract_v02.yml
---
documentStructureId: "109a562d-8290-407d-98e1-e5e31c9808b7"
elements:
- templateElementId:
id: "cover"
templateNames:
hu_HU: "/full-example/01-cover_v03.docx"
defaultLocale: "hu_HU"
count: 1
- templateElementId:
id: "contract"
templateNames:
en: "/full-example/02-contract_v09_en.docx"
hu: "/full-example/02-contract_v09_hu.docx"
defaultLocale: "hu_HU"
count: 1
- templateElementId:
id: "terms"
templateNames:
hu: "/full-example/03-terms_v02.docx"
defaultLocale: "hu_HU"
count: 1
- templateElementId:
id: "conditions"
templateNames:
hu: "/full-example/04-conditions_eco_v11.xlsx"
defaultLocale: "hu_HU"
count: 1
resultMode: "SEPARATE_DOCUMENTS"
outputFormat: "UNCHANGED"
copies: 1
To compile the project locally some configuration settings are needed:
AWS S3 template repository:
What you will need:
an AWS account and an S3 bucket.
Add the environment variables below to the project configuration or shell:
Name | Description |
---|---|
GETTHEDOCS_REPO_TEMPLATE_AWS_S3_BUCKETNAME | Your test bucket’s name |
GETTHEDOCS_REPO_DOCSTRUCTURE_AWS_S3_BUCKETNAME | Your test bucket’s name |
GETTHEDOCS_REPO_RESULT_AWS_S3_BUCKETNAME | Your test bucket’s name |
AWS_ACCESS_KEY_ID | The AWS access key id for a user having S3 object RW permissions. |
AWS_SECRET_ACCESS_KEY | The secret key for the access key id |
Issue tracking: Get-the-docs project @ Atlassian Jira