Qorstack ReportQorstack Report
Documentation
Self-Host
GitHub

Getting Started

Template Features

Qorstack Report Documentation

Design DOCX or XLSX templates, send JSON, get your document. This guide covers every template feature from simple variable replacement to tables, images, QR codes, barcodes, PDF security, and ZIP output.

Overview

Qorstack Report Service generates PDF, DOCX, and Excel documents from Word (.docx) and Excel (.xlsx) templates. Instead of maintaining complex layout code, you design templates visually, upload them, and send a simple JSON payload to generate the final file.

Zero Data Retention

In production, Qorstack Report operates with a strict Zero Data Retention policy. Your JSON payload is processed in volatile memory and destroyed the moment the PDF is rendered.

Template-based Generation

Recurring reports, batch generation, and self-host integrations

POST

Use a pre-uploaded DOCX or XLSX template stored in your project. Reference the template by key and send JSON data to render the final document.

/render/word/templateor/render/excel/template

Auth header

x-api-key

Key field

templateKey

Variables

Replace placeholders with actual text data like customer names or dates.

Tables

Automatically generate tables from array data with dynamic rows.

Images

Insert images from Base64 or URLs with custom sizing.

QR Codes

Generate QR codes on the fly for payments or links.

Barcodes

Generate barcodes on the fly for product tracking.

File Settings

Protect PDFs, apply watermarks, and package output as ZIP.

Integration & SDKs

Choose your preferred integration method. We provide official SDKs for Node.js and .NET, or you can use the REST API directly with any HTTP client.

REST API / Raw HTTP

No installation required. Use any HTTP client.

  • API URL: http://localhost:8080/render/word/template
  • Headers: Include x-api-key in your request headers.

Request Example

PropertyTypeRequiredPlanDescription
templateKeystringYes
FREE
Template identifier for the uploaded DOCX/XLSX template.
fileNamestringNo
FREE
Output PDF filename (default: "output").
replaceobjectNo
FREE
Text variable replacements.
tablearrayNo
FREE
Dynamic table data (TableDataRequest[]).
imageobjectNo
FREE
Image insertion data.
qrcodeobjectNo
FREE
QR code generation data.
barcodeobjectNo
FREE
Barcode generation data.
pdfPasswordobjectNo
FREE
PDF password and permission options.
watermarkobjectNo
FREE
PDF text watermark options.
zipOutputbooleanNo
FREE
Return the generated output as a ZIP file.
1Method: POST
2URL: ${API_URL}/render/word/template
3Headers:
4  Content-Type: application/json
5  X-API-KEY: YOUR_API_KEY
6
7Body (JSON):
8{
9  "templateKey": "YOUR_TEMPLATE_KEY",
10  "fileName": "sales_report_2026",
11  "pdfPassword": {
12    "userPassword": "viewer-pass",
13    "ownerPassword": "owner-pass",
14    "restrictPrinting": true,
15    "restrictCopying": true,
16    "restrictModifying": true
17  },
18  "watermark": {
19    "text": "CONFIDENTIAL",
20    "fontSize": 48,
21    "fontFamily": "Helvetica",
22    "fontWeight": 700,
23    "fontItalic": false,
24    "color": "#64748B",
25    "opacity": 0.14,
26    "rotation": -45,
27    "positionX": "center",
28    "positionY": "center",
29    "pages": [
30      1
31    ]
32  },
33  "zipOutput": false,
34  "replace": {
35    "report_date": "2026-05-20",
36    "prepared_by": "Operations Team"
37  },
38  "table": [
39    {
40      "rows": [
41        {
42          "item": "Product A",
43          "qty": "10",
44          "price": "100"
45        },
46        {
47          "item": "Product B",
48          "qty": "5",
49          "price": "200"
50        }
51      ],
52      "sort": []
53    }
54  ],
55  "image": {
56    "header_logo": {
57      "src": "https://example.com/logo.png",
58      "width": 150,
59      "height": 50,
60      "fit": "contain"
61    }
62  },
63  "qrcode": {
64    "scan_me": {
65      "text": "https://qorstack.dev",
66      "size": 100
67    }
68  },
69  "barcode": {
70    "order_id": {
71      "text": "ORD-2026-001",
72      "format": "Code128",
73      "width": 200,
74      "height": 50,
75      "includeText": true,
76      "color": "#111827",
77      "backgroundColor": "#FFFFFF"
78    }
79  }
80}

Variable Replacement

Use {{variable}} in your Word document to define placeholders.

Template (.docx)

Variables in Word

Data Payload

PropertyTypeRequiredPlanDescription
keystringYes
FREE
Template variable name (e.g. {{name}} -> "name").
valuestringYes
FREE
Replacement text.
1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "invoice-2026-001",
4  "zipOutput": false,
5  "replace": {
6    "customer_name": "Acme Co., Ltd.",
7    "invoice_number": "INV-2026-001",
8    "issue_date": "2026-05-20",
9    "due_date": "2026-06-20",
10    "subtotal": "7200",
11    "tax": "504",
12    "total": "7704",
13    "notes": "Generated from the current render API."
14  },
15  "table": [],
16  "image": {},
17  "qrcode": {},
18  "barcode": {}
19}

Tables

Create dynamic tables using {{row:field}} markers inside a table row. The API expects a table array where each item contains rows.

Template (.docx)

Put {{row:name}}, {{row:qty}}, and other row markers in the template row that should repeat.

Table in Word
PropertyTypeRequiredPlanDescription
tableWordTableDataRequest[]No
FREE
Array of table data requests.
rowsRecord<string, any>[]Yes
FREE
Array of row objects matching {{row:key}} markers in the template.
repeatHeaderbooleanNo
FREE
Repeat the Word table header row on each page.
1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "product-catalog",
4  "zipOutput": false,
5  "replace": {},
6  "table": [
7    {
8      "rows": [
9        {
10          "category": "Electronics",
11          "name": "Laptop Pro",
12          "stock": "15",
13          "price": "1200"
14        },
15        {
16          "category": "Electronics",
17          "name": "Wireless Mouse",
18          "stock": "50",
19          "price": "25"
20        },
21        {
22          "category": "Furniture",
23          "name": "Ergo Chair",
24          "stock": "8",
25          "price": "350"
26        },
27        {
28          "category": "Furniture",
29          "name": "Standing Desk",
30          "stock": "12",
31          "price": "500"
32        }
33      ],
34      "sort": [
35        {
36          "field": "category",
37          "direction": "asc"
38        },
39        {
40          "field": "price",
41          "direction": "desc"
42        }
43      ],
44      "verticalMerge": [
45        "category"
46      ],
47      "collapse": [
48        "category"
49      ]
50    }
51  ],
52  "image": {},
53  "qrcode": {},
54  "barcode": {}
55}

Tables (Advanced)

Advanced table features including sorting, grouping, vertical merge, collapse, and aggregates.

Advanced Properties

PropertyTypeRequiredPlanDescription
sortRecord<string, "asc" | "desc">No
FREE
Sorting rules (e.g. { "price": "desc" }).
verticalMergestring[]No
FREE
Merges cells with identical values vertically.ex. ["category", "date"]
collapsestring[]No
FREE
Collapses identical rows into a single row.ex. ["date", "store_branch"]

Template Grouping Styles

Header Row Grouping

Place the Header row above the data row to display a group header (used in conjunction with the first verticalMerge item).

Item NameQtyPrice
Category: {{group:category}} ({{group_count}} items)
{{row:name}}{{row:qty}}{{row:price}}

Note: Use the {{group:field}} marker in the Header Row to indicate where the group name will be displayed.

Footer Grouping

Place a summary row below the data row to show the total at the end of each group.

Item NameQtyPrice
{{row:name}}{{row:qty}}{{row:price}}
Total for {{group:category}}{{group_sum:qty}}Total {{group_sum:price}}

Aggregates

Table Scope

Used to display the grand totals for the entire table.

{{table_count}}Total item count
{{table_sum:field}}Grand total sum
{{table_avg:field}}Grand total average
Group Scope

Used in the Group Header or Group Footer.

{{group_count}}Group item count
{{group_sum:field}}Group subtotal sum
{{group_avg:field}}Group subtotal average
Row Scope

Used to calculate values between fields in the same row.

{{row_sum:f1,f2}}Sum of specific fields
{{row_avg:f1,f2}}Average of specific fields

Images

Insert images dynamically using {{image:variable}}.

Template (.docx)

Images in Word

Data Payload

PropertyTypeRequiredPlanDescription
srcstringYes
FREE
Image URL, data URL, or stored file URL.
widthnumberNo
FREE
Image width (px).
heightnumberNo
FREE
Image height (px).
fitstringNo
FREE
Image fit: "cover", "contain", "fill".
1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "company-profile",
4  "zipOutput": false,
5  "replace": {},
6  "table": [],
7  "image": {
8    "company_logo": {
9      "src": "https://example.com/logo.png",
10      "width": 150,
11      "height": 50,
12      "fit": "contain"
13    },
14    "signature": {
15      "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
16      "width": 200,
17      "height": 100,
18      "fit": "contain"
19    }
20  },
21  "qrcode": {},
22  "barcode": {}
23}

QR Codes

Generate QR codes automatically with {{qrcode:variable}}.

Template (.docx)

QR Code in Word

Data Payload

PropertyTypeRequiredPlanDescription
textstringYes
FREE
Content to encode.
sizenumberNo
FREE
QR code size (px).
colorstringNo
FREE
Foreground color, e.g. "#111827".
backgroundColorstringNo
FREE
Background color.
logostringNo
FREE
Optional logo URL placed in the QR code center.
1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "ticket-001",
4  "zipOutput": false,
5  "replace": {},
6  "table": [],
7  "image": {},
8  "qrcode": {
9    "ticket_qr": {
10      "text": "https://event.com/ticket/123456",
11      "size": 200
12    },
13    "wifi_access": {
14      "text": "WIFI:S:MyNetwork;T:WPA;P:password123;;",
15      "size": 150
16    }
17  },
18  "barcode": {}
19}

Barcodes

Generate Barcodes automatically with {{barcode:variable}}.

Template (.docx)

Barcode in Word

Data Payload

PropertyTypeRequiredPlanDescription
textstringYes
FREE
Content to encode.
formatstringNo
FREE
Barcode format, default "Code128".
widthnumberNo
FREE
Barcode width (px).
heightnumberNo
FREE
Barcode height (px).
includeTextbooleanNo
FREE
Show human-readable text under the bars.
colorstringNo
FREE
Foreground color.
backgroundColorstringNo
FREE
Background color.
1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "inventory-label",
4  "zipOutput": false,
5  "replace": {},
6  "table": [],
7  "image": {},
8  "qrcode": {},
9  "barcode": {
10    "sku_barcode": {
11      "text": "SKU-99887766",
12      "format": "Code128",
13      "width": 200,
14      "height": 60,
15      "includeText": true,
16      "color": "#111827",
17      "backgroundColor": "#FFFFFF"
18    },
19    "serial_number": {
20      "text": "SN-2026-001-X",
21      "format": "Code128",
22      "width": 300,
23      "height": 80,
24      "includeText": true,
25      "color": "#111827",
26      "backgroundColor": "#FFFFFF"
27    }
28  }
29}

File Settings

Configure high-level render options such as PDF password protection, watermarking, and ZIP output.

Template (.docx)

PDF password watermark and ZIP output

Security & Encryption

Protect your generated PDF files with a password. This uses standard PDF encryption which prevents unauthorized viewing.

PropertyTypeRequiredPlanDescription
pdfPassword.userPasswordstringNo
PRO
Password required to open the generated PDF.
pdfPassword.ownerPasswordstringNo
PRO
Owner password used to apply PDF permission restrictions.
restrictPrintingbooleanNo
PRO
Disallow printing when supported by the PDF reader.
restrictCopyingbooleanNo
PRO
Disallow copying text or images when supported by the PDF reader.
restrictModifyingbooleanNo
PRO
Disallow modifying the PDF when supported by the PDF reader.

Branding & Watermarking

Add a non-removable watermark text across all pages of the document.

PropertyTypeRequiredPlanDescription
watermark.textstringNo
PRO
Text to be displayed as a watermark (e.g. "CONFIDENTIAL").
fontSizenumberNo
PRO
Watermark font size.
fontFamilystringNo
PRO
Font family name.
fontWeightnumberNo
PRO
Font weight, e.g. 400 or 700.
fontItalicbooleanNo
PRO
Use italic font style.
colorstringNo
PRO
Watermark color.
opacitynumberNo
PRO
Opacity from 0 to 1.
rotationnumberNo
PRO
Rotation angle in degrees.
positionXstringNo
PRO
Horizontal position, e.g. "center".
positionYstringNo
PRO
Vertical position, e.g. "center".
pagesnumber[]No
PRO
Optional 1-based page list.

Output Packaging

PropertyTypeRequiredPlanDescription
zipOutputbooleanNo
FREE
Return a ZIP archive instead of the raw generated file.

Data Payload

1{
2  "templateKey": "YOUR_TEMPLATE_KEY",
3  "fileName": "protected_contract",
4  "pdfPassword": {
5    "userPassword": "viewer-pass",
6    "ownerPassword": "owner-pass",
7    "restrictPrinting": true,
8    "restrictCopying": true,
9    "restrictModifying": true
10  },
11  "watermark": {
12    "text": "CONFIDENTIAL",
13    "fontSize": 48,
14    "fontFamily": "Helvetica",
15    "fontWeight": 700,
16    "fontItalic": false,
17    "color": "#64748B",
18    "opacity": 0.14,
19    "rotation": -45,
20    "positionX": "center",
21    "positionY": "center",
22    "pages": [
23      1,
24      2
25    ]
26  },
27  "zipOutput": true,
28  "replace": {
29    "customer_name": "Acme Co., Ltd.",
30    "contract_date": "2026-05-20"
31  },
32  "table": [],
33  "image": {},
34  "qrcode": {},
35  "barcode": {}
36}
NextPricing

On this page

Qorstack ReportQorstack Report

© 2026 Qorstack Report.
Built for the developer era.

Product

Company

  • GitHub

Legal

© 2026 Qorstack Report. All rights reserved.

Made withfor developers