feat: add presentation JSON Schema with basic and full examples

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 12:37:09 +08:00
co-authored by Claude Sonnet 5
parent 17d232dcef
commit c1a9c2fcda
3 changed files with 1195 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
{
"presentation": {
"layout": "LAYOUT_16x9",
"author": "Demo Author",
"title": "Basic Presentation"
},
"slides": [
{
"objects": [
{
"type": "text",
"text": "Welcome to PPTX Demo",
"options": {
"x": 1.0,
"y": 2.0,
"w": 8.0,
"h": 1.5,
"fontSize": 44,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true,
"align": "center",
"valign": "middle"
}
}
]
},
{
"objects": [
{
"type": "text",
"text": "Section Title",
"options": {
"x": 0.5,
"y": 0.3,
"w": 9.0,
"h": 0.8,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "text",
"text": "This is the body content of the slide. It demonstrates a typical title and body layout used in presentations.",
"options": {
"x": 0.5,
"y": 1.5,
"w": 9.0,
"h": 3.0,
"fontSize": 18,
"fontFace": "Calibri",
"color": "333333",
"align": "left",
"valign": "top",
"wrap": true
}
}
]
}
]
}
+374
View File
@@ -0,0 +1,374 @@
{
"presentation": {
"layout": "LAYOUT_16x9",
"author": "Jane Developer",
"title": "Full Feature Demo",
"subject": "Demonstrating all PPTX slide object types",
"company": "Acme Corp",
"revision": "3",
"rtlMode": false,
"theme": {
"headFontFace": "Calibri Light",
"bodyFontFace": "Calibri"
}
},
"slides": [
{
"background": {
"color": "2E75B6",
"transparency": 0
},
"objects": [
{
"type": "text",
"text": "Full Feature Demo",
"options": {
"x": 0,
"y": 1.5,
"w": 10,
"h": 1.5,
"fontSize": 48,
"fontFace": "Arial",
"color": "FFFFFF",
"bold": true,
"align": "center",
"valign": "middle"
}
},
{
"type": "text",
"text": "PowerPoint Generation via JSON",
"options": {
"x": 0,
"y": 3.2,
"w": 10,
"h": 0.8,
"fontSize": 20,
"fontFace": "Calibri",
"color": "D9E2F3",
"align": "center",
"valign": "top"
}
}
]
},
{
"objects": [
{
"type": "text",
"text": "Text Formatting",
"options": {
"x": 0.5,
"y": 0.2,
"w": 9.0,
"h": 0.6,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "text",
"text": "Bold and italic text",
"options": {
"x": 0.5,
"y": 1.0,
"w": 4.0,
"h": 0.5,
"fontSize": 16,
"fontFace": "Calibri",
"bold": true,
"italic": true
}
},
{
"type": "text",
"text": "Left aligned with underline",
"options": {
"x": 0.5,
"y": 1.7,
"w": 4.0,
"h": 0.5,
"fontSize": 14,
"fontFace": "Calibri",
"color": "0070C0",
"underline": { "style": "sng", "color": "0070C0" }
}
},
{
"type": "text",
"text": "Right aligned text",
"options": {
"x": 5.5,
"y": 1.0,
"w": 4.0,
"h": 0.5,
"fontSize": 14,
"fontFace": "Calibri",
"color": "C00000",
"align": "right"
}
},
{
"type": "text",
"text": "Bullet point 1\nBullet point 2\nBullet point 3",
"options": {
"x": 0.5,
"y": 2.5,
"w": 9.0,
"h": 1.5,
"fontSize": 14,
"fontFace": "Calibri",
"bullet": { "type": "bullet", "characterCode": "25BA" },
"valign": "top"
}
}
]
},
{
"objects": [
{
"type": "text",
"text": "Shapes",
"options": {
"x": 0.5,
"y": 0.2,
"w": 9.0,
"h": 0.6,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "shape",
"shapeName": "rect",
"options": {
"x": 0.5,
"y": 1.2,
"w": 2.5,
"h": 2.0,
"fill": { "color": "4472C4", "transparency": 20 },
"line": { "color": "000000", "width": 1 },
"shadow": { "type": "outer", "blur": 8, "offset": 4, "angle": 45, "color": "999999" }
}
},
{
"type": "shape",
"shapeName": "ellipse",
"options": {
"x": 3.8,
"y": 1.2,
"w": 2.5,
"h": 2.0,
"fill": { "color": "ED7D31" },
"line": { "color": "333333", "width": 2 }
}
},
{
"type": "shape",
"shapeName": "roundRect",
"options": {
"x": 7.0,
"y": 1.2,
"w": 2.5,
"h": 2.0,
"fill": { "color": "70AD47" },
"line": { "color": "000000", "width": 1.5, "dashType": "dash" },
"rectRadius": 0.2
}
}
]
},
{
"slideNumber": {
"x": 9.0,
"y": 5.0,
"fontSize": 10,
"color": "888888"
},
"objects": [
{
"type": "text",
"text": "Images and Hyperlinks",
"options": {
"x": 0.5,
"y": 0.2,
"w": 9.0,
"h": 0.6,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "image",
"options": {
"x": 0.5,
"y": 1.2,
"w": 4.0,
"h": 3.0,
"path": "https://via.placeholder.com/800x600.png?text=Sample+Image",
"sizing": { "type": "contain", "w": 4.0, "h": 3.0 },
"shadow": { "type": "outer", "blur": 6, "offset": 3, "angle": 45, "color": "666666" },
"hyperlink": { "url": "https://example.com", "tooltip": "Visit Example" }
}
},
{
"type": "text",
"text": "Click the image above to visit Example.com",
"options": {
"x": 0.5,
"y": 4.5,
"w": 4.0,
"h": 0.5,
"fontSize": 12,
"fontFace": "Calibri",
"color": "4472C4",
"align": "center"
}
}
]
},
{
"objects": [
{
"type": "text",
"text": "Table with colspan and rowspan",
"options": {
"x": 0.5,
"y": 0.2,
"w": 9.0,
"h": 0.6,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "table",
"rows": [
[
{ "text": "Product", "options": { "bold": true, "fill": { "color": "4472C4" }, "color": "FFFFFF", "fontSize": 14 } },
{ "text": "Q1 Sales", "options": { "bold": true, "fill": { "color": "4472C4" }, "color": "FFFFFF", "fontSize": 14 } },
{ "text": "Q2 Sales", "options": { "bold": true, "fill": { "color": "4472C4" }, "color": "FFFFFF", "fontSize": 14 } },
{ "text": "Total", "options": { "bold": true, "fill": { "color": "4472C4" }, "color": "FFFFFF", "fontSize": 14 } }
],
[
{ "text": "Widget A", "options": { "fill": { "color": "D9E2F3" } } },
{ "text": "$12,000", "options": { "fill": { "color": "D9E2F3" }, "align": "right" } },
{ "text": "$15,000", "options": { "fill": { "color": "D9E2F3" }, "align": "right" } },
{ "text": "$27,000", "options": { "fill": { "color": "D9E2F3" }, "align": "right", "bold": true } }
],
[
{ "text": "Widget B", "options": { "fill": { "color": "EDEDED" } } },
{ "text": "$8,500", "options": { "fill": { "color": "EDEDED" }, "align": "right" } },
{ "text": "$9,200", "options": { "fill": { "color": "EDEDED" }, "align": "right" } },
{ "text": "$17,700", "options": { "fill": { "color": "EDEDED" }, "align": "right", "bold": true } }
],
[
{ "text": "Combined Regions", "options": { "bold": true, "fill": { "color": "E2EFDA" } }, "colspan": 3 },
{ "text": "$44,700", "options": { "bold": true, "fill": { "color": "E2EFDA" }, "align": "right" } }
]
],
"options": {
"x": 0.5,
"y": 1.2,
"w": 9.0,
"h": 3.5,
"colW": [3.0, 2.0, 2.0, 2.0],
"border": { "type": "solid", "color": "000000", "pt": 1 },
"fontSize": 12
}
}
]
},
{
"objects": [
{
"type": "text",
"text": "Bar Chart Example",
"options": {
"x": 0.5,
"y": 0.2,
"w": 9.0,
"h": 0.6,
"fontSize": 28,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true
}
},
{
"type": "chart",
"chartType": "bar",
"data": [
{
"name": "North Region",
"labels": ["Q1", "Q2", "Q3", "Q4"],
"values": [45, 52, 38, 61]
},
{
"name": "South Region",
"labels": ["Q1", "Q2", "Q3", "Q4"],
"values": [33, 41, 47, 55]
}
],
"options": {
"x": 0.5,
"y": 1.2,
"w": 9.0,
"h": 4.5,
"chartColors": ["4472C4", "ED7D31"],
"showTitle": true,
"showLegend": true,
"showValue": false,
"catAxisTitle": "Quarter",
"valAxisTitle": "Revenue ($K)",
"barGapWidthPct": 80
}
}
]
},
{
"hidden": false,
"objects": [
{
"type": "text",
"text": "Thank You!",
"options": {
"x": 0,
"y": 1.8,
"w": 10,
"h": 1.2,
"fontSize": 40,
"fontFace": "Arial",
"color": "2E75B6",
"bold": true,
"align": "center",
"valign": "middle"
}
},
{
"type": "text",
"text": "Questions?",
"options": {
"x": 0,
"y": 3.2,
"w": 10,
"h": 0.8,
"fontSize": 20,
"fontFace": "Calibri",
"color": "666666",
"align": "center",
"valign": "top"
}
}
]
}
]
}