Iteration Layer
Menu
Features
Use Cases
Docs
Resources
Pricing
Document Generation

Generate PDF, DOCX, EPUB, and PPTX from structured data

Define document blocks, styles, and fonts in JSON. Get back PDF, DOCX, EPUB, or PPTX files.

Zero data retention Made & hosted in the EU 100 trial credits

See Document Generation in action

Start from a real implementation pattern, not blank docs. See the input, runnable code, and structured output your workflow can use next.

Input Preview
{
  "format": "pdf",
  "document": {
    "metadata": { "title": "Series A Board Pack" },
    "page": {
      "size": { "preset": "A4" },
      "margins": {
        "top_in_pt": 48,
        "right_in_pt": 48,
        "bottom_in_pt": 54,
        "left_in_pt": 48
      }
    },
    "styles": {
      "text": { "font_family": "Helvetica", "font_size_in_pt": 11, "color": "#334155", "line_height": 1.5 },
      "headline": { "font_family": "Helvetica", "font_size_in_pt": 28, "color": "#0F172A", "font_weight": "bold" },
      "table": {
        "header": { "background_color": "#E2E8F0", "text_color": "#0F172A", "font_size_in_pt": 10, "font_weight": "bold" },
        "body": { "background_color": "#FFFFFF", "text_color": "#334155", "font_size_in_pt": 10 }
      }
    },
    "content": [
      { "type": "headline", "level": "h1", "text": "Series A Board Pack" },
      { "type": "paragraph", "markdown": "**Q4 revenue:** USD 4.8M  |  **Gross margin:** 78%  |  **Net retention:** 123%" },
      { "type": "separator" },
      { "type": "headline", "level": "h2", "text": "Operating Highlights" },
      { "type": "list", "variant": "unordered", "items": [
        { "text": "Opened Frankfurt region with 14 enterprise accounts" },
        { "text": "Reduced median document extraction latency to 1.9 seconds" },
        { "text": "Launched deterministic OG image generation for every public page" }
      ] },
      { "type": "headline", "level": "h2", "text": "Regional Revenue" },
      { "type": "table", "column_widths_in_percent": [34, 22, 18, 26], "header": { "cells": [
        { "text": "Region" },
        { "text": "Revenue" },
        { "text": "Growth" },
        { "text": "Gross Margin" }
      ] }, "rows": [
        { "cells": [{ "text": "North America" }, { "text": "USD 2.1M" }, { "text": "+31%" }, { "text": "81%" }] },
        { "cells": [{ "text": "Europe" }, { "text": "USD 1.7M" }, { "text": "+26%" }, { "text": "77%" }] },
        { "cells": [{ "text": "APAC" }, { "text": "USD 1.0M" }, { "text": "+18%" }, { "text": "73%" }] }
      ] },
      { "type": "paragraph", "markdown": "Next quarter focus: enterprise onboarding, deeper spreadsheet generation adoption, and gross margin expansion." }
    ]
  }
}
Output Preview
Generated board pack PDF preview

First page preview of the generated PDF

Request
curl -X POST \
  https://api.iterationlayer.com/document-generation/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "format": "pdf",
  "document": {
    "metadata": {
      "title": "Series A Board Pack"
    },
    "page": {
      "size": { "preset": "A4" },
      "margins": {
        "top_in_pt": 48,
        "right_in_pt": 48,
        "bottom_in_pt": 54,
        "left_in_pt": 48
      }
    },
    "styles": {
      "text": {
        "font_family": "Helvetica",
        "font_size_in_pt": 11,
        "color": "#334155",
        "line_height": 1.5
      },
      "headline": {
        "font_family": "Helvetica",
        "font_size_in_pt": 28,
        "color": "#0F172A",
        "font_weight": "bold"
      },
      "table": {
        "header": {
          "background_color": "#E2E8F0",
          "text_color": "#0F172A",
          "font_size_in_pt": 10,
          "font_weight": "bold"
        },
        "body": {
          "background_color": "#FFFFFF",
          "text_color": "#334155",
          "font_size_in_pt": 10
        }
      }
    },
    "content": [
      {
        "type": "headline",
        "level": "h1",
        "text": "Series A Board Pack"
      },
      {
        "type": "paragraph",
        "markdown": "**Q4 revenue:** USD 4.8M  |  **Gross margin:** 78%  |  **Net retention:** 123%"
      },
      {
        "type": "separator"
      },
      {
        "type": "headline",
        "level": "h2",
        "text": "Operating Highlights"
      },
      {
        "type": "list",
        "variant": "unordered",
        "items": [
          { "text": "Opened Frankfurt region with 14 enterprise accounts" },
          { "text": "Reduced median document extraction latency to 1.9 seconds" },
          { "text": "Launched deterministic OG image generation for every public page" }
        ]
      },
      {
        "type": "headline",
        "level": "h2",
        "text": "Regional Revenue"
      },
      {
        "type": "table",
        "column_widths_in_percent": [34, 22, 18, 26],
        "header": {
          "cells": [
            { "text": "Region" },
            { "text": "Revenue" },
            { "text": "Growth" },
            { "text": "Gross Margin" }
          ]
        },
        "rows": [
          { "cells": [{ "text": "North America" }, { "text": "USD 2.1M" }, { "text": "+31%" }, { "text": "81%" }] },
          { "cells": [{ "text": "Europe" }, { "text": "USD 1.7M" }, { "text": "+26%" }, { "text": "77%" }] },
          { "cells": [{ "text": "APAC" }, { "text": "USD 1.0M" }, { "text": "+18%" }, { "text": "73%" }] }
        ]
      },
      {
        "type": "paragraph",
        "markdown": "Next quarter focus: enterprise onboarding, deeper spreadsheet generation adoption, and margin expansion."
      }
    ]
  }
}'
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
import { IterationLayer } from "iterationlayer";

const client = new IterationLayer({
  apiKey: "YOUR_API_KEY",
});

const result = await client.generateDocument({
  format: "pdf",
  document: {
    metadata: { title: "Series A Board Pack" },
    page: {
      size: { preset: "A4" },
      margins: {
        top_in_pt: 48,
        right_in_pt: 48,
        bottom_in_pt: 54,
        left_in_pt: 48,
      },
    },
    styles: {
      text: {
        font_family: "Helvetica",
        font_size_in_pt: 11,
        color: "#334155",
        line_height: 1.5,
      },
      headline: {
        font_family: "Helvetica",
        font_size_in_pt: 28,
        color: "#0F172A",
        font_weight: "bold",
      },
      table: {
        header: {
          background_color: "#E2E8F0",
          text_color: "#0F172A",
          font_size_in_pt: 10,
          font_weight: "bold",
        },
        body: {
          background_color: "#FFFFFF",
          text_color: "#334155",
          font_size_in_pt: 10,
        },
      },
    },
    content: [
      {
        type: "headline",
        level: "h1",
        text: "Series A Board Pack",
      },
      {
        type: "paragraph",
        markdown: "**Q4 revenue:** USD 4.8M  |  **Gross margin:** 78%  |  **Net retention:** 123%",
      },
      {
        type: "separator",
      },
      {
        type: "headline",
        level: "h2",
        text: "Operating Highlights",
      },
      {
        type: "list",
        variant: "unordered",
        items: [
          { text: "Opened Frankfurt region with 14 enterprise accounts" },
          { text: "Reduced median document extraction latency to 1.9 seconds" },
          { text: "Launched deterministic OG image generation for every public page" },
        ],
      },
      {
        type: "headline",
        level: "h2",
        text: "Regional Revenue",
      },
      {
        type: "table",
        column_widths_in_percent: [34, 22, 18, 26],
        header: {
          cells: [
            { text: "Region" },
            { text: "Revenue" },
            { text: "Growth" },
            { text: "Gross Margin" },
          ],
        },
        rows: [
          { cells: [{ text: "North America" }, { text: "USD 2.1M" }, { text: "+31%" }, { text: "81%" }] },
          { cells: [{ text: "Europe" }, { text: "USD 1.7M" }, { text: "+26%" }, { text: "77%" }] },
          { cells: [{ text: "APAC" }, { text: "USD 1.0M" }, { text: "+18%" }, { text: "73%" }] },
        ],
      },
      {
        type: "paragraph",
        markdown: "Next quarter focus: enterprise onboarding, deeper spreadsheet generation adoption, and margin expansion.",
      },
    ],
  },
});
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
from iterationlayer import IterationLayer

client = IterationLayer(
    api_key="YOUR_API_KEY"
)

result = client.generate_document(
    format="pdf",
    document={
        "metadata": {
            "title": "Series A Board Pack",
        },
        "page": {
            "size": {"preset": "A4"},
            "margins": {
                "top_in_pt": 48,
                "right_in_pt": 48,
                "bottom_in_pt": 54,
                "left_in_pt": 48,
            },
        },
        "styles": {
            "text": {
                "font_family": "Helvetica",
                "font_size_in_pt": 11,
                "color": "#334155",
                "line_height": 1.5,
            },
            "headline": {
                "font_family": "Helvetica",
                "font_size_in_pt": 28,
                "color": "#0F172A",
                "font_weight": "bold",
            },
            "table": {
                "header": {
                    "background_color": "#E2E8F0",
                    "text_color": "#0F172A",
                    "font_size_in_pt": 10,
                    "font_weight": "bold",
                },
                "body": {
                    "background_color": "#FFFFFF",
                    "text_color": "#334155",
                    "font_size_in_pt": 10,
                },
            },
        },
        "content": [
            {
                "type": "headline",
                "level": "h1",
                "text": "Series A Board Pack",
            },
            {
                "type": "paragraph",
                "markdown": "**Q4 revenue:** USD 4.8M  |  **Gross margin:** 78%  |  **Net retention:** 123%",
            },
            {
                "type": "separator",
            },
            {
                "type": "headline",
                "level": "h2",
                "text": "Operating Highlights",
            },
            {
                "type": "list",
                "variant": "unordered",
                "items": [
                    {"text": "Opened Frankfurt region with 14 enterprise accounts"},
                    {"text": "Reduced median document extraction latency to 1.9 seconds"},
                    {"text": "Launched deterministic OG image generation for every public page"},
                ],
            },
            {
                "type": "headline",
                "level": "h2",
                "text": "Regional Revenue",
            },
            {
                "type": "table",
                "column_widths_in_percent": [34, 22, 18, 26],
                "header": {
                    "cells": [
                        {"text": "Region"},
                        {"text": "Revenue"},
                        {"text": "Growth"},
                        {"text": "Gross Margin"},
                    ]
                },
                "rows": [
                    {"cells": [{"text": "North America"}, {"text": "USD 2.1M"}, {"text": "+31%"}, {"text": "81%"}]},
                    {"cells": [{"text": "Europe"}, {"text": "USD 1.7M"}, {"text": "+26%"}, {"text": "77%"}]},
                    {"cells": [{"text": "APAC"}, {"text": "USD 1.0M"}, {"text": "+18%"}, {"text": "73%"}]},
                ],
            },
            {
                "type": "paragraph",
                "markdown": "Next quarter focus: enterprise onboarding, deeper spreadsheet generation adoption, and margin expansion.",
            },
        ],
    },
)
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
import il "github.com/iterationlayer/sdk-go"

client := il.NewClient("YOUR_API_KEY")

result, err := client.GenerateDocument(
  il.GenerateDocumentRequest{
    Format: "pdf",
    Document: il.DocumentDefinition{
      Metadata: il.DocumentMetadata{
        Title: "Series A Board Pack",
      },
      Page: il.DocumentPage{
        Size: il.DocPageSize{
          Preset: "A4",
        },
        Margins: il.DocMargins{
          TopInPt:    48,
          RightInPt:  48,
          BottomInPt: 54,
          LeftInPt:   48,
        },
      },
      Styles: il.DocumentStyles{
        Text: il.TextStyle{
          FontFamily:  "Helvetica",
          FontSizeInPt: 11,
          Color:       "#334155",
          LineHeight:  1.5,
        },
        Headline: il.HeadlineStyle{
          FontFamily:  "Helvetica",
          FontSizeInPt: 28,
          Color:       "#0F172A",
        },
      },
      Content: []il.ContentBlock{
        il.NewHeadlineBlock("h1", "Series A Board Pack"),
        il.ParagraphBlock{
          Type:     "paragraph",
          Markdown: "**Q4 revenue:** USD 4.8M  |  **Gross margin:** 78%  |  **Net retention:** 123%",
        },
        il.NewSeparatorBlock(),
        il.NewHeadlineBlock("h2", "Operating Highlights"),
        il.ListBlock{Type: "list", Variant: "unordered", Items: []il.ListItem{
          {Text: "Opened Frankfurt region with 14 enterprise accounts"},
          {Text: "Reduced median document extraction latency to 1.9 seconds"},
          {Text: "Launched deterministic OG image generation for every public page"},
        }},
        il.NewHeadlineBlock("h2", "Regional Revenue"),
        il.NewTableBlock([]il.TableRow{
          {Cells: []il.TableCell{{Text: "North America"}, {Text: "USD 2.1M"}, {Text: "+31%"}, {Text: "81%"}}},
          {Cells: []il.TableCell{{Text: "Europe"}, {Text: "USD 1.7M"}, {Text: "+26%"}, {Text: "77%"}}},
          {Cells: []il.TableCell{{Text: "APAC"}, {Text: "USD 1.0M"}, {Text: "+18%"}, {Text: "73%"}}},
        }),
        il.ParagraphBlock{Type: "paragraph", Markdown: "Next quarter focus: enterprise onboarding, deeper spreadsheet generation adoption, and margin expansion."},
      },
    },
  },
)
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}

Use the same workflow from code, agents, or n8n

When an automation moves from prototype to production, you should not have to rebuild it for every environment. Iteration Layer lets scripts, agents, and n8n workflows call the same European AI workflow runtime.

Input 40+ file formats
Extraction Documents, websites, and markdown
Generation Documents, images, and sheets
Output Structured format

Fits into your existing stack

Native SDKs for TypeScript, Python, and Go. OpenAPI spec for everything else. MCP server for AI agents and Claude Code skills. n8n integration for visual workflows.

EU AI workflow runtime

Run document, image, and file steps through one EU-hosted workflow layer with shared API conventions and billing.

Agent-ready by design

Expose the same document and image actions to MCP tools and Claude Code skills, then reuse the API contract when workflows graduate into scripts or automations.

Verified n8n node

Install the verified Iteration Layer node in n8n, then route documents and generated files through the same provider from visual workflows.

Three steps to your first document

01

Define your document

Describe metadata, page size, fonts, and styles. Choose from 19 page size presets (A0-A6, B0-B6, Letter, Legal, Tabloid, Executive, Statement) or set custom dimensions.

02

Add content blocks

Build your document from 12 block types: paragraphs with rich text, headlines (h1-h6), images, tables, 12-column grids, ordered and unordered lists, table of contents, separators, QR codes, and barcodes.

03

Choose your format

Get back a base64-encoded document in PDF, DOCX, EPUB, or PPTX. Headers, footers, and page numbers are supported. For PPTX, each page break creates a new slide.


Templates As Code

12 content block types — paragraphs, tables, grids, lists, QR codes, barcodes — defined as JSON. No template engine, no typesetting language, no browser.

One API, Four Formats

Generate PDF, DOCX, EPUB, and PPTX from the same document definition. EPUB and PPTX are rare capabilities most document APIs don't offer. Switch the format field — the content and styles carry over.

Two-Layer Styles

Set document-wide defaults for fonts, colors, and spacing, then override per block. Custom TTF, OTF, WOFF, and WOFF2 fonts with weight and style variants, 19 page size presets.

Real-world pipelines, ready to ship

Each recipe chains multiple APIs into a complete workflow. Pick one, tweak it, and deploy — or use it as a starting point for your own pipeline.

Generate a Compliance Audit Document

Generate a formatted PDF compliance audit document with findings, risk ratings, remediation recommendations, and sign-off sections.

Generate DOCX Contract

Generate an editable DOCX service agreement with parties, terms, and payment schedule.

Generate Employee Offer Letter

Generate a professional offer letter PDF with role, compensation, start date, and company details.

Generate EPUB Book

Generate a complete EPUB e-book with chapters, table of contents, and rich text formatting.

Generate NDA

Generate a non-disclosure agreement PDF with party names, effective date, and standard confidentiality terms.

Generate Packing Slip

Generate a packing slip PDF with order details, item list, and shipping address.

Generate PDF Certificate

Generate a professional achievement certificate with recipient name, course details, date, and a QR code for formal download or print.

Generate PDF Invoice

Generate a professional PDF invoice with company branding, line items, and totals.

Generate PDF Manuscript

Generate a print-ready PDF manuscript with title page, table of contents, and chapters at 6x9 inch trim size.

Generate PDF Report

Generate a professional PDF report with title, executive summary, data table, and footer.

Generate Product Datasheet

Generate a professional product specification sheet with images, feature tables, technical specs, and contact information.

Generate Quarterly Report

Create a structured quarterly business report with table of contents, data tables, and page numbers.

Generate Restaurant Menu

Generate a branded restaurant menu PDF with sections, items, prices, and descriptions.

Generate Shipping Label

Generate a compact PDF shipping label with sender and recipient addresses, barcode, and tracking number.

Generate Slide Deck

Build a PowerPoint slide deck with title slide, content slides, and call-to-action page.

Generate a White-Label PDF Report

Generate a branded PDF report with custom client logo placeholder, colors, and content sections for white-label agency delivery.

Convert Markdown to Styled PDF

Generate a professionally styled PDF document from Markdown content with custom fonts, headers, and page numbers.

European by design

Your data is processed on EU-hosted infrastructure and never stored beyond temporary logs. Zero data retention, GDPR-compliant workflows, and a Data Processing Agreement are available for every customer. Learn more about our security practices .

EU-hosted core processing

Application and processing infrastructure runs in Europe, with provider-scope ISO 27001 and BSI C5 evidence documented for procurement reviews.

Zero data retention

Customer files and processing results are not stored after the request. Usage logs are retained for 90 days and automatically deleted.

Clear answers for security teams

Give reviewers the answers they need up front: where files are processed, what is retained, which subprocessors are involved, and how AI inputs, outputs, review gates, and audit records move through each workflow.

Pricing

Start usage-based. Switch to a subscription when your volume becomes predictable.

Pay as you go

Usage-based

$0.099 to $0.069 / credit

Graduated pricing. Your effective rate decreases automatically as monthly usage grows.

  • No monthly commitment
  • Pay only for credits used
  • Automatic volume discounts as usage grows
Subscriptions

Predictable volume

From $19 /month

Fixed recurring credit packs with lower effective credit prices for steady usage.

  • Lower effective per-credit prices
  • Fixed recurring credit packs
  • Predictable monthly budget
Trial Week

Try Iteration Layer with 100 credits

$1 / 7 days

Start with one shared trial pool before choosing subscription or pay-as-you-go billing.

All APIs included 7-day trial Project-based budget caps Auto overage billing

Still evaluating?

Compare Iteration Layer against the biggest alternatives at a glance, then open the full head-to-head pages when you want the details.

Feature Iteration Layer Carbone DocRaptor Puppeteer
Output formats
4 formats
PDF, DOCX, EPUB, and PPTX from the same content definition
PDF
Primarily PDF output via LibreOffice rendering from DOCX/ODT templates
PDF, XLS
PDF and XLS output via Prince XML rendering engine
PDF only
Generates PDF output only
Template model
JSON blocks
Content defined as JSON block arrays — versionable and diffable
Binary files
Templates are DOCX or ODT binary files that cannot be diffed or reviewed in version control
HTML/CSS
Uses HTML and CSS Paged Media specification, which is separate from standard browser CSS
HTML/JS
HTML and CSS rendered through a full Chromium browser engine
Custom fonts
Yes
Upload and use custom fonts in any document
Limited
Fonts must be installed in the LibreOffice environment before they can be used
Yes
Fonts referenced via CSS @font-face declarations pointing to hosted font files
System fonts
Uses fonts installed on the system or loaded via CSS @font-face
Infrastructure required
None
Fully managed API with no deployment or infrastructure to manage
Self-hosted
Requires self-hosting or using Carbone Cloud
None
Fully managed SaaS platform with no infrastructure to manage
Chromium
Requires Node.js and a Chromium instance consuming 200-300 MB per concurrent render

See how we compare to our competitors

Carbone DocRaptor Puppeteer Gotenberg

Frequently asked questions

What output formats are supported?
The API generates PDF, DOCX, EPUB, and PPTX documents. All formats are created from the same document definition, so you can switch formats without changing your content.
How does the style system work?
You define document-level defaults for text, headlines, tables, and other elements. Individual blocks can override any style property. This two-layer system keeps your documents consistent while allowing per-block customization.
Can I use custom fonts?
Yes. Embed any TTF, OTF, WOFF, or WOFF2 font by including its base64-encoded buffer in the request. Specify weight (thin to black) and style (normal or italic) for each font variant.
What content blocks are available?
The API supports 12 block types: paragraph (with rich text and markdown), headline (h1-h6), image, table, grid (12-column layout), list (ordered and unordered with nesting), table of contents, page break, separator, page number, QR code, and barcode.
How do PPTX slides work?
For PPTX output, each page-break block creates a new slide. Content before the first page break goes on slide 1. Headlines become slide titles, and other blocks are mapped to slide elements.
Can I add headers and footers?
Yes, for PDF and DOCX output. Define header and footer content using the same block types as the main body. Headers and footers appear on every page. Use the page-number block type to show page numbers. EPUB and PPTX do not support headers and footers.

Build your first workflow in minutes

Chain our APIs into a workflow you can test with your own data during the 7-day trial.

Zero data retention Made & hosted in the EU 100 trial credits