Documentation
1. Templates
Templates are written using Razor-like syntax (similar to .cshtml files).
You can define dynamic content using @ expressions, loops, and conditions.
Your template will receive data in the form of a model (JSON object), but you should avoid declaring the model type at the top (e.g., @model MyModel should be omitted).
You can access property by the key word @Model.NameOfProperty.
Each template should be uploaded by its unique name. Name will be used to specify template in /Report and /Reports endpoints.
✔ Example: foreach loop
<ul>
@foreach (var item in Model.Items)
{
<li>@item.Name - @item.Price</li>
}
</ul>
✔ Example: conditional logic
@if (Model.IsPaid)
{
<p>Thank you for your payment.</p>
}
else
{
<p>Payment is pending.</p>
}
✔ Styling
You can use inline styles or embed CSS in a <style> tag inside your template:
<style>
.title {
font-size: 24px;
font-weight: bold;
color: #333;
}
</style>
<div class="title">Invoice</div>
✔ Images
- You can use public image URLs in your templates:
<img src="https://yourdomain.com/image.png" /> - You can also embed Base64 images directly in HTML using data URIs.
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." />
Looking for code examples? See the Examples section on the Home page.
2. Endpoints
For swagger documentation click here.
To generate reports, use the following HTTP POST endpoints. You must include your API key in the Authorization header.
YOUR_API_KEYContent-Type:
application/json
📄 Single Report
POST /api/report
🔸 Description
Generates a single PDF document using a specified template and data object.
🔸 Request Body
| Field | Type | Required | Description |
|---|---|---|---|
templateName |
string | Yes | Name of the saved template |
templateData |
object | Yes | JSON object passed to the template |
🔸 Example Request
POST /api/report
Authorization: YOUR_API_KEY
Content-Type: application/json
{
"templateName": "Invoice",
"templateData": {
"Customer": "John Doe",
"Total": 199.99,
"IsPaid": true
}
}
🔸 Response
200 OK — Returns a PDF file (application/pdf)
📄 Batch Reports
POST /api/reports
🔸 Description
Generates a multi-page PDF by rendering the same template multiple times with different data objects.
🔸 Request Body
| Field | Type | Required | Description |
|---|---|---|---|
templateName |
string | Yes | Name of the saved template |
templateData |
array of objects | Yes |
A list of data objects (each one rendered as a page). Maximum: 25 items |
🔸 Example Request
POST /api/reports
Authorization: YOUR_API_KEY
Content-Type: application/json
{
"templateName": "Invoice",
"templateData": [
{
"Customer": "Alice Smith",
"Total": 120.00,
"IsPaid": true
},
{
"Customer": "Bob Johnson",
"Total": 85.50,
"IsPaid": false
}
]
}
🔸 Response
200 OK — Returns a PDF file (application/pdf) with multiple pages