render_document_pdf — Render Markdown or HTML Document to Themed PDF

Compiles Markdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or HTML into both print-ready themed HTML and a spec-compliant multi-page PDF 1.7 binary with running headers, 'Page X of Y' footers, repeated table headers across page breaks, optional watermark, and deterministic layoutDiagnostics.

Why buy vs. DIY: Avoids spinning up 400MB Puppeteer/Playwright containers or hand-rolling brittle PDF stream/xref math; returns both binary PDF and layout QA diagnostics in <20ms at $0.004.

Pricing: $0.004 USD per rendered PDF document (x402 instant micropayment) · REST: POST https://pdf-forge.apikeg.com/v1/render-document-pdf · MCP: https://pdf-forge.apikeg.com/mcp

Input Parameters

FieldTypeRequired / DefaultDescription & Constraints
content string Required Markdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or raw HTML body to compile. (minLength: 1, maxLength: 524288)
contentFormat string Default: "markdown" Input syntax format ('markdown' or 'html'). (enum: markdown | html)
title string Optional Optional document title rendered in the cover banner and stored in PDF /Title metadata. (maxLength: 240)
subtitle string Optional Optional subtitle rendered below the title and stored in PDF /Subject metadata. (maxLength: 320)
author string Optional Optional author or organization name rendered in the cover banner and PDF /Author metadata. (maxLength: 160)
theme string Default: "executive" Corporate print styling theme ('executive', 'invoice', 'technical', or 'memo'). (enum: executive | invoice | technical | memo)
pageSize string Default: "Letter" Paper size ('Letter', 'A4', or 'Legal'). (enum: Letter | A4 | Legal)
orientation string Default: "portrait" Page orientation ('portrait' or 'landscape'). (enum: portrait | landscape)
headerText string Optional Optional running header stamped at the top margin of every page. (maxLength: 180)
includePageNumbers boolean Default: true Include 'Page X of Y' running footers on every page.
watermarkText string Optional Optional diagonal watermark text rendered across every page (e.g. 'CONFIDENTIAL' or 'DRAFT'). (maxLength: 80)

REST Example (curl)

curl -X POST "https://pdf-forge.apikeg.com/v1/render-document-pdf" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Q4 Cloud FinOps Executive Summary",
  "subtitle": "Quarterly Infrastructure Margin & Savings Audit",
  "author": "Platform FinOps Team",
  "theme": "executive",
  "pageSize": "Letter",
  "orientation": "portrait",
  "contentFormat": "markdown",
  "headerText": "ACME CORP — Q4 FINOPS AUDIT",
  "includePageNumbers": true,
  "watermarkText": "CONFIDENTIAL",
  "content": "## Highlights\n\nNet cloud margin improved **420 bps** quarter-over-quarter.\n\n| Service | Q3 Spend | Q4 Spend | Delta |\n| --- | ---: | ---: | ---: |\n| Compute | $142,000 | $118,500 | -16.5% |\n| Storage | $38,400 | $35,100 | -8.6% |\n\n> [!NOTE]\n> Reserved capacity commitments lock in an additional $95k annualized savings."
}'

MCP tools/call Payload

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "render_document_pdf",
    "arguments": {
      "title": "Q4 Cloud FinOps Executive Summary",
      "subtitle": "Quarterly Infrastructure Margin & Savings Audit",
      "author": "Platform FinOps Team",
      "theme": "executive",
      "pageSize": "Letter",
      "orientation": "portrait",
      "contentFormat": "markdown",
      "headerText": "ACME CORP — Q4 FINOPS AUDIT",
      "includePageNumbers": true,
      "watermarkText": "CONFIDENTIAL",
      "content": "## Highlights\n\nNet cloud margin improved **420 bps** quarter-over-quarter.\n\n| Service | Q3 Spend | Q4 Spend | Delta |\n| --- | ---: | ---: | ---: |\n| Compute | $142,000 | $118,500 | -16.5% |\n| Storage | $38,400 | $35,100 | -8.6% |\n\n> [!NOTE]\n> Reserved capacity commitments lock in an additional $95k annualized savings."
    }
  }
}