@veztraa/report-cli
v0.3.3
Published
Render and validate JSON report templates to PDF from the command line. Supports all 12 element types including signature blocks and multilingual text (Chinese, Japanese, Korean, Arabic, Hebrew, Hindi, Thai). No Chromium, no Python.
Maintainers
Readme
@veztraa/report-cli
Render and validate ReportForge PDF report templates from the command line — point it at a template JSON and a data JSON and get a PDF back. No code required, which makes it ideal for scripts, batch jobs, and CI pipelines.
Pure Node.js — no Chromium, no Python, no headless browser. All 12 element types are supported including signature blocks, repeating container bands, charts, barcodes, and rich text. Tables, rich text, and bands paginate across pages automatically. Multilingual content (Chinese, Japanese, Korean, Arabic, Hebrew, Hindi, Thai) renders via Noto fonts loaded automatically on first use.
Quick start (no install)
npx @veztraa/report-cli render template.json data.json --output report.pdfInstall globally
npm install -g @veztraa/report-cli
# Now the `report-designer` command is available anywhere:
report-designer render template.json data.json --output report.pdfCommands
render
Render a template + data to a PDF file.
report-designer render <template> [data] [options]
Arguments:
template Path to the template JSON file
data Path to the data JSON file (optional)
Options:
-o, --output Output PDF path (default: output.pdf)
-w, --watch Re-render whenever the template or data file changes# Basic render
report-designer render invoice.json data.json --output invoice.pdf
# Watch mode — re-renders on every file save (great for iterating on a template)
report-designer render invoice.json data.json --output invoice.pdf --watchvalidate
Validate a template JSON against the ReportForge schema (no PDF generated). Exits non-zero on failure, so it works as a CI guard.
report-designer validate invoice.json
# ✔ Template is valid
# or
# ✖ Validation failed: <list of issues>Supported element types
text · richtext · table · container (repeating band) · image · chart · barcode · qrcode · rectangle · line · pagebreak · signature
Template format
Templates are plain JSON files matching the ReportForge schema. See @veztraa/report-core for the full schema, element types, and expression syntax.
template.json
{
"version": "1.0",
"name": "Hello World",
"page": { "size": "A4", "orientation": "portrait", "margin": { "top": 30, "right": 30, "bottom": 30, "left": 30 } },
"header": { "height": 0, "elements": [] },
"footer": { "height": 0, "elements": [] },
"body": {
"elements": [
{
"id": "title",
"type": "text",
"x": 0, "y": 0, "width": 535, "height": 40,
"content": "Hello, {{name}}!",
"style": { "fontSize": 24, "fontWeight": "bold" }
},
{
"id": "sig",
"type": "signature",
"x": 0, "y": 60, "width": 240, "height": 92,
"name": "{{signer.name}}",
"title": "{{signer.title}}",
"label": "Authorized Signature",
"scriptFont": "Great Vibes"
}
]
}
}data.json
{
"name": "World",
"signer": { "name": "Jane Smith", "title": "CEO, Acme Corp" }
}Multilingual PDFs
Set style.fontFamily to any Noto family for non-Latin scripts — fonts are fetched from CDN automatically:
{
"id": "cjk",
"type": "text",
"content": "日本語のテキスト",
"style": { "fontFamily": "Noto Sans JP", "fontSize": 14 }
}Supported: Noto Sans (Latin/Cyrillic/Greek) · Noto Sans SC (Chinese) · Noto Sans JP (Japanese) · Noto Sans KR (Korean) · Noto Sans Arabic · Noto Sans Hebrew · Noto Sans Devanagari (Hindi) · Noto Sans Thai
Use it in code instead?
If you need to generate PDFs programmatically (in a Node.js API, serverless function, or the browser), use @veztraa/report-renderer directly — render(template, data) returns a PDF buffer.
Keywords
pdf cli pdf-cli pdf-generator report command-line pdf-render template-to-pdf npx signature multilingual reportforge
License
MIT © Veztraa Solutions
