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": "Certificate of Completion - Advanced Data Engineering",
"author": "Horizon Academy"
},
"page": {
"size": { "width_in_pt": 842, "height_in_pt": 595 },
"margins": {
"top_in_pt": 60,
"right_in_pt": 72,
"bottom_in_pt": 60,
"left_in_pt": 72
}
},
"styles": {
"text": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333"
},
"headline": {
"font_family": "Helvetica",
"font_size_in_pt": 24.0,
"color": "#111111",
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 6.0,
"is_bold": true
},
"link": {
"color": "#0066CC",
"is_underlined": true
},
"list": {
"text_style": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333"
},
"marker_color": "#333333",
"marker_gap_in_pt": 8.0
},
"table": {
"header": {
"background_color": "#333333",
"text_color": "#FFFFFF",
"font_size_in_pt": 11.0,
"is_bold": true
},
"body": {
"background_color": "#FFFFFF",
"text_color": "#333333",
"font_size_in_pt": 11.0
},
"border": {
"outer": {
"top": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"right": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"bottom": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"left": { "color": "#CCCCCC", "width_in_pt": 1.0 }
},
"inner": {
"horizontal": { "color": "#EEEEEE", "width_in_pt": 0.5 },
"vertical": { "color": "#EEEEEE", "width_in_pt": 0.5 }
}
}
},
"grid": {
"background_color": "#FFFFFF",
"border_color": "#CCCCCC",
"border_width_in_pt": 0.0,
"gap_in_pt": 12.0
},
"separator": {
"color": "#CCCCCC",
"thickness_in_pt": 1.0,
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 12.0
},
"image": {
"border_color": "#000000",
"border_width_in_pt": 0.0
}
},
"content": [
{ "type": "headline", "level": "h3", "text": "HORIZON ACADEMY" },
{ "type": "separator" },
{ "type": "headline", "level": "h1", "text": "Certificate of Completion" },
{ "type": "paragraph", "runs": [{ "text": "This certificate is proudly presented to" }] },
{ "type": "headline", "level": "h1", "text": "James Whitfield" },
{ "type": "paragraph", "runs": [{ "text": "for successfully completing the course" }] },
{ "type": "headline", "level": "h2", "text": "Advanced Data Engineering with Apache Spark" },
{ "type": "paragraph", "markdown": "Completed on **March 1, 2026** with a score of **94%** after 42 hours of coursework covering distributed data processing, pipeline orchestration, and performance optimization." },
{ "type": "separator" },
{ "type": "grid", "columns": [
{ "column_span": 4, "blocks": [
{ "type": "paragraph", "runs": [{ "text": "Certificate ID", "is_bold": true }] },
{ "type": "paragraph", "runs": [{ "text": "CERT-2026-ADE-07284" }] }
]},
{ "column_span": 4, "blocks": [
{ "type": "paragraph", "runs": [{ "text": "Issued By", "is_bold": true }] },
{ "type": "paragraph", "runs": [{ "text": "Dr. Elena Marchetti, Program Director" }] }
]},
{ "column_span": 4, "blocks": [
{
"type": "qr-code",
"value": "https://verify.horizonacademy.com/cert/2026-ADE-07284",
"width_in_pt": 80,
"height_in_pt": 80,
"fg_hex_color": "#000000",
"bg_hex_color": "#FFFFFF"
}
]}
]}
]
}
}'{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.generateDocument({
format: "pdf",
document: {
metadata: {
title: "Certificate of Completion - Advanced Data Engineering",
author: "Horizon Academy",
},
page: {
size: { width_in_pt: 842, height_in_pt: 595 },
margins: {
top_in_pt: 60,
right_in_pt: 72,
bottom_in_pt: 60,
left_in_pt: 72,
},
},
styles: {
text: {
font_family: "Helvetica",
font_size_in_pt: 11.0,
line_height: 1.5,
color: "#333333",
},
headline: {
font_family: "Helvetica",
font_size_in_pt: 24.0,
color: "#111111",
spacing_before_in_pt: 12.0,
spacing_after_in_pt: 6.0,
is_bold: true,
},
link: {
color: "#0066CC",
is_underlined: true,
},
list: {
text_style: {
font_family: "Helvetica",
font_size_in_pt: 11.0,
line_height: 1.5,
color: "#333333",
},
marker_color: "#333333",
marker_gap_in_pt: 8.0,
},
table: {
header: {
background_color: "#333333",
text_color: "#FFFFFF",
font_size_in_pt: 11.0,
is_bold: true,
},
body: {
background_color: "#FFFFFF",
text_color: "#333333",
font_size_in_pt: 11.0,
},
border: {
outer: {
top: { color: "#CCCCCC", width_in_pt: 1.0 },
right: { color: "#CCCCCC", width_in_pt: 1.0 },
bottom: { color: "#CCCCCC", width_in_pt: 1.0 },
left: { color: "#CCCCCC", width_in_pt: 1.0 },
},
inner: {
horizontal: { color: "#EEEEEE", width_in_pt: 0.5 },
vertical: { color: "#EEEEEE", width_in_pt: 0.5 },
},
},
},
grid: {
background_color: "#FFFFFF",
border_color: "#CCCCCC",
border_width_in_pt: 0.0,
gap_in_pt: 12.0,
},
separator: {
color: "#CCCCCC",
thickness_in_pt: 1.0,
spacing_before_in_pt: 12.0,
spacing_after_in_pt: 12.0,
},
image: {
border_color: "#000000",
border_width_in_pt: 0.0,
},
},
content: [
{ type: "headline", level: "h3", text: "HORIZON ACADEMY" },
{ type: "separator" },
{ type: "headline", level: "h1", text: "Certificate of Completion" },
{ type: "paragraph", runs: [{ text: "This certificate is proudly presented to" }] },
{ type: "headline", level: "h1", text: "James Whitfield" },
{ type: "paragraph", runs: [{ text: "for successfully completing the course" }] },
{ type: "headline", level: "h2", text: "Advanced Data Engineering with Apache Spark" },
{ type: "paragraph", markdown: "Completed on **March 1, 2026** with a score of **94%** after 42 hours of coursework covering distributed data processing, pipeline orchestration, and performance optimization." },
{ type: "separator" },
{ type: "grid", columns: [
{ column_span: 4, blocks: [
{ type: "paragraph", runs: [{ text: "Certificate ID", is_bold: true }] },
{ type: "paragraph", runs: [{ text: "CERT-2026-ADE-07284" }] },
]},
{ column_span: 4, blocks: [
{ type: "paragraph", runs: [{ text: "Issued By", is_bold: true }] },
{ type: "paragraph", runs: [{ text: "Dr. Elena Marchetti, Program Director" }] },
]},
{ column_span: 4, blocks: [
{
type: "qr-code",
value: "https://verify.horizonacademy.com/cert/2026-ADE-07284",
width_in_pt: 80,
height_in_pt: 80,
fg_hex_color: "#000000",
bg_hex_color: "#FFFFFF",
},
]},
]},
],
},
});
console.log(result);{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.generate_document(
format="pdf",
document={
"metadata": {
"title": "Certificate of Completion - Advanced Data Engineering",
"author": "Horizon Academy",
},
"page": {
"size": {"width_in_pt": 842, "height_in_pt": 595},
"margins": {
"top_in_pt": 60,
"right_in_pt": 72,
"bottom_in_pt": 60,
"left_in_pt": 72,
},
},
"styles": {
"text": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333",
},
"headline": {
"font_family": "Helvetica",
"font_size_in_pt": 24.0,
"color": "#111111",
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 6.0,
"is_bold": True,
},
"link": {
"color": "#0066CC",
"is_underlined": True,
},
"list": {
"text_style": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333",
},
"marker_color": "#333333",
"marker_gap_in_pt": 8.0,
},
"table": {
"header": {
"background_color": "#333333",
"text_color": "#FFFFFF",
"font_size_in_pt": 11.0,
"is_bold": True,
},
"body": {
"background_color": "#FFFFFF",
"text_color": "#333333",
"font_size_in_pt": 11.0,
},
"border": {
"outer": {
"top": {"color": "#CCCCCC", "width_in_pt": 1.0},
"right": {"color": "#CCCCCC", "width_in_pt": 1.0},
"bottom": {"color": "#CCCCCC", "width_in_pt": 1.0},
"left": {"color": "#CCCCCC", "width_in_pt": 1.0},
},
"inner": {
"horizontal": {"color": "#EEEEEE", "width_in_pt": 0.5},
"vertical": {"color": "#EEEEEE", "width_in_pt": 0.5},
},
},
},
"grid": {
"background_color": "#FFFFFF",
"border_color": "#CCCCCC",
"border_width_in_pt": 0.0,
"gap_in_pt": 12.0,
},
"separator": {
"color": "#CCCCCC",
"thickness_in_pt": 1.0,
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 12.0,
},
"image": {
"border_color": "#000000",
"border_width_in_pt": 0.0,
},
},
"content": [
{"type": "headline", "level": "h3", "text": "HORIZON ACADEMY"},
{"type": "separator"},
{"type": "headline", "level": "h1", "text": "Certificate of Completion"},
{"type": "paragraph", "runs": [{"text": "This certificate is proudly presented to"}]},
{"type": "headline", "level": "h1", "text": "James Whitfield"},
{"type": "paragraph", "runs": [{"text": "for successfully completing the course"}]},
{"type": "headline", "level": "h2", "text": "Advanced Data Engineering with Apache Spark"},
{"type": "paragraph", "markdown": "Completed on **March 1, 2026** with a score of **94%** after 42 hours of coursework covering distributed data processing, pipeline orchestration, and performance optimization."},
{"type": "separator"},
{"type": "grid", "columns": [
{"column_span": 4, "blocks": [
{"type": "paragraph", "runs": [{"text": "Certificate ID", "is_bold": True}]},
{"type": "paragraph", "runs": [{"text": "CERT-2026-ADE-07284"}]},
]},
{"column_span": 4, "blocks": [
{"type": "paragraph", "runs": [{"text": "Issued By", "is_bold": True}]},
{"type": "paragraph", "runs": [{"text": "Dr. Elena Marchetti, Program Director"}]},
]},
{"column_span": 4, "blocks": [
{
"type": "qr-code",
"value": "https://verify.horizonacademy.com/cert/2026-ADE-07284",
"width_in_pt": 80,
"height_in_pt": 80,
"fg_hex_color": "#000000",
"bg_hex_color": "#FFFFFF",
},
]},
]},
],
},
)
print(result){
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}package main
import (
"fmt"
il "github.com/iterationlayer/sdk-go"
)
func main() {
client := il.NewClient("YOUR_API_KEY")
result, err := client.GenerateDocument(il.GenerateDocumentRequest{
Format: "pdf",
Document: il.DocumentDefinition{
Metadata: il.DocumentMetadata{
Title: "Certificate of Completion - Advanced Data Engineering",
Author: "Horizon Academy",
},
Page: il.PageConfig{
Size: il.PageSize{WidthInPt: 842, HeightInPt: 595},
Margins: il.Margins{TopInPt: 60, RightInPt: 72, BottomInPt: 60, LeftInPt: 72},
},
Content: []il.ContentBlock{
il.NewHeadlineBlock("h3", "HORIZON ACADEMY"),
il.NewSeparatorBlock(),
il.NewHeadlineBlock("h1", "Certificate of Completion"),
il.ParagraphBlock{Type: "paragraph", Markdown: "This certificate is proudly presented to"},
il.NewHeadlineBlock("h1", "James Whitfield"),
il.ParagraphBlock{Type: "paragraph", Markdown: "for successfully completing the course"},
il.NewHeadlineBlock("h2", "Advanced Data Engineering with Apache Spark"),
il.ParagraphBlock{Type: "paragraph", Markdown: "Completed on **March 1, 2026** with a score of **94%** after 42 hours of coursework."},
il.NewSeparatorBlock(),
il.NewDocumentQrCodeBlock("https://verify.horizonacademy.com/cert/2026-ADE-07284", 80, 80),
},
},
})
if err != nil {
panic(err)
}
fmt.Println(result)
}{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}