Fork me on GitHub
Latest release0.1.0-alpha.1

OPEN SOURCE DOCUMENT GENERATION

Documents from
your templates.

Bring a Word template and your data. Create documents that keep your layout, with the content your readers need.

Java 17 · Apache 2.0 · Run it on your infrastructure

Evaluation alpha. APIs are not yet stable.

YOUR DATA
{
  "customer": { "name": "Ada" },
  "reference": "NF-001",
  "draft": false
}
NuaFormaNF-001

Project summary

Prepared for Ada

ItemQuantity
Template design1
Document delivery3
Your formatting. Your content.
DOCX & PDF
Word templates in.DOCXorPDF · PDF/A-1b · PDF/A-2b · PDF/A-3bout.

FOR BUSINESSES & INDIVIDUALS

Keep the document.
Change the details.

Letters, agreements and reports often share a structure. NuaForma fills that structure with your own data, without making you redesign the document.

01

Author in Word

Keep styles, tables, images, headers and supported text boxes. Add placeholders and conditional content where they belong.

02

Make content relevant

Include or omit sections, repeat table rows, and handle nested lists and empty values. One template can serve several situations.

03

Choose the result

Generate editable DOCX, ordinary PDF or validated B-level PDF/A. Add a text watermark when a document is still a draft.

04

Keep control

Run on your own infrastructure. Document generation needs no cloud account or network downloads. You choose your fonts and data.

This is an evaluation alpha, not a promise to reproduce every Word feature. Read the supported profiles and known limitations ↗

FOR DEVELOPERS

An engine first.
A service when you need one.

Embed the Java 17 engine in Kotlin or Java, or use the same engine through the REST service. Format support is discovered through public provider contracts.

Available in the alpha

  • DOCX → DOCX and DOCX → PDF
  • Nested conditions, repetitions and generic JSON data
  • Null fallbacks, string checks, number and date formatting
  • Text watermarks, supplied fonts and font-based barcodes
  • ServiceLoader providers and separately usable libraries
  • Multipart REST, capabilities and OpenAPI JSON/YAML
build.gradle.kts
dependencies {
    implementation("dev.nuaforma:nuaforma-core:0.1.0-alpha.1")
    implementation("dev.nuaforma:nuaforma-docx:0.1.0-alpha.1")
}

DOCX-only applications do not need Docker or LibreOffice. PDF requires the separately configured isolated runtime. Maven Central ↗

WHAT COMES NEXT

Follow the roadmap

Planned 0.2.0 work includes a CycloneDX SBOM endpoint and follow-up on accepted native-runtime security findings. Spreadsheet and OpenDocument providers, signable forms and template storage are future research, not available features.

View open issues ↗
How to deployCompose · Dockerfile · Helm

Use the published Linux/amd64 image. Keep it private behind an authenticated TLS gateway for remote access. Preserve non-root execution, a read-only filesystem, bounded temporary storage and the reviewed seccomp profile.

Run with Docker Compose

No custom image build is required. Download the complete Docker deployment kit: the Compose file requires the included seccomp.json. Keep that reviewed profile alongside compose.yaml; do not replace it with privileged or unconfined execution.

compose.yaml
services:
  nuaforma:
    image: ghcr.io/nuaforma/nuaforma:0.1.0-alpha.1
    platform: linux/amd64
    init: true
    user: "1000:1000"
    read_only: true
    cap_drop: [ALL]
    security_opt:
      - no-new-privileges:true
      - seccomp=./seccomp.json
    pids_limit: 128
    mem_limit: 2g
    cpus: 2
    tmpfs:
      - /tmp:rw,size=512m,mode=1777
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      NUAFORMA_HEAP_MB: "512"
      NUAFORMA_HOST: "0.0.0.0"
      NUAFORMA_PORT: "8080"
    volumes:
      - ./custom-fonts:/opt/nuaforma/custom-fonts:ro
      - ./extensions:/opt/nuaforma/extensions:ro
    stop_grace_period: 15s

Create custom-fonts and extensions next to the Compose file. Place your own TTF/OTF fonts in custom-fonts, readable by UID/GID 1000; restart after changing fonts or trusted extension JARs. Both directories are mounted read-only.

Terminal
mkdir -p custom-fonts extensions
docker compose up -d
curl --fail http://127.0.0.1:8080/api/v1/capabilities

# Stop the service when finished:
docker compose down

The service binds to your computer's loopback port 8080. There is no built-in authentication or TLS: use an authenticated TLS gateway before making it accessible to remote users. Check capabilities for PDF availability on your host.

TRY IT ON YOUR OWN INSTALLATION

One template.
Several ways to fill it.

Download a Word template with images, tables, nested conditions and repeating content. Pick a JSON request below and submit it to your NuaForma service with Bruno, curl or another HTTP client.

Nothing is uploaded to this website. It does not generate documents or connect to your service. All template/data submissions happen in your own HTTP client.

Loading examples

request.json
Download this JSON ↓
Send a request with Bruno or curl
  1. Start NuaForma on your own machine and check GET /api/v1/capabilities.
  2. Create POST http://127.0.0.1:8080/api/v1/documents with a multipart form body.
  3. Add a request part containing the selected JSON with content type application/json. A JSON file part works too.
  4. Add the downloaded Word file as a file part named template. Let your client create the multipart boundary.
  5. Save the binary response as .pdf or .docx, according to the request. Read JSON diagnostics if the status is not 200.
Terminal
curl --fail-with-body http://127.0.0.1:8080/api/v1/documents \
  -F 'request=@01-final-pdfa3b.json;type=application/json' \
  -F 'template=@nuaforma-example-template.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document' \
  --output example.pdf

data holds template values. General options such as locale and watermark live under options; PDF profile options live under output.options. The website examples are complete request envelopes, not just data objects.

THE REST ENDPOINTS

See what is available.
Then create a document.

GET/api/v1/version

Packaged version, contract version and source commit. Does not check PDF readiness.

GET/api/v1/capabilities

Providers, usable formats, option descriptions and bundled/mounted font catalogs. Private uploads are never listed.

POST/api/v1/assess

Send the JSON request envelope to assess options and provider readiness. No template is uploaded or validated.

POST/api/v1/documents

Send multipart request, template and optional resource files. Receive a document attachment or structured diagnostics.

GET/openapi.json · /openapi.yaml

Download equivalent OpenAPI definitions from your own service for documentation and client tooling.

Typical error statuses: 400 malformed transport, 422 invalid or unsupported content/options, 408 deadline exceeded, 503 provider unavailable. Consult the REST guide for the full contract and limits.

BUILT IN THE OPEN

Try a template.
Bring your use case.

Use NuaForma internally or embed it in your application. Feedback and small, non-confidential examples help shape what comes next.

Explore the repository ↗

Evaluation alpha. Native-runtime security findings remain under review for 0.2.0. See issue #51 and the release notes. No authentication or TLS is built into the service.