Documents Active

FPDF Generation

Template-based PDF generation service supporting text, images, barcodes (1D/2D), shapes, watermarks, and label sheets. Use JSON templates with data binding for dynamic content. Perfect for invoices, shipping labels, product tags, and any document generation needs. See the Element Reference for complete documentation of all element types and properties.

https://fpdf-generation.localapi.ro
< 500ms Response Time
1/sec Rate Limit
None Auth Required
Free Pricing

Quick Start

Request
curl -X POST "https://fpdf-generation.localapi.ro/render" \
  -H "Content-Type: application/json" \
  -d '{
    "template": {
      "page": {"format": "A4"},
      "elements": [
        {"type": "text", "bounds": {"x": 10, "y": 10, "width": 100, "height": 20},
         "text": {"content": "Hello {name}!", "fontSize": 24, "fontStyle": "B"}}
      ]
    },
    "data": {"name": "World"}
  }' --output document.pdf
Request
import requests

response = requests.post(
    "https://fpdf-generation.localapi.ro/render",
    json={
        "template": {
            "page": {"format": "A4"},
            "elements": [
                {
                    "type": "text",
                    "bounds": {"x": 10, "y": 10, "width": 100, "height": 20},
                    "text": {"content": "Hello {name}!", "fontSize": 24}
                }
            ]
        },
        "data": {"name": "World"}
    }
)

with open("document.pdf", "wb") as f:
    f.write(response.content)
print("PDF saved!")
Request
const response = await fetch("https://fpdf-generation.localapi.ro/render", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    template: {
      page: { format: "A4" },
      elements: [
        {
          type: "text",
          bounds: { x: 10, y: 10, width: 100, height: 20 },
          text: { content: "Hello {name}!", fontSize: 24 }
        }
      ]
    },
    data: { name: "World" }
  })
});

const blob = await response.blob();
const url = URL.createObjectURL(blob);
// Download or display the PDF

Response

200 OK application/pdf
Binary PDF content

Available Endpoints

POST /render

Render a single PDF from a template and data.

Parameters

Parameter Type Required Description
template object | string Yes Template object or base64-encoded gzip (auto-detected)
data object No Data for {placeholder} substitution in text, images, barcodes
POST /render-labels

Render a label sheet with repeating elements.

Parameters

Parameter Type Required Description
template object | string Yes Template with labelGrid (auto-detects gzip)
data array Yes Array of data objects, one per label
skipPositions array No Label positions to skip (0-indexed)
GET /healthz

Check service health and availability status.

GET /docs

Interactive Swagger UI documentation.

GET /openapi.json

OpenAPI 3.0 specification.

Error Codes

Code Description
400 Invalid request - malformed JSON or missing required fields
422 Validation error - invalid template structure or element properties
429 Rate limit exceeded
500 Internal server error - PDF generation failed