Presentation Properties
Core Properties
Core metadata is written to docProps/core.xml and read back on parse. Set these fields directly on the presentation options:
{
"title": "Quarterly Review",
"subject": "Finance",
"creator": "Jane Doe",
"keywords": "q4, review",
"description": "Quarterly business review",
"revision": 2,
"slides": []
}
import { generatePresentation } from "@office-open/pptx";
const buffer = await generatePresentation({
title: "Quarterly Review",
subject: "Finance",
creator: "Jane Doe",
keywords: "q4, review",
description: "Quarterly business review",
revision: 2,
slides: [
/* … */
],
});
| Property | Type | Description |
|---|---|---|
title | string | Presentation title |
subject | string | Subject |
creator | string | Author |
keywords | string | Keywords |
description | string | Description |
lastModifiedBy | string | Last modifier |
revision | number | Revision number |
lastPrinted | string | Last printed date (W3CDTF) |
created | string | Creation date (W3CDTF) |
modified | string | Last modified date (W3CDTF) |
Extended Properties
appProperties are written to docProps/app.xml. The commonly user-set fields are template, manager, company, and application; the rest (slides, notes, totalTime, …) are document statistics typically computed by Office:
{
"appProperties": { "company": "Globex", "manager": "Jane Doe" },
"slides": []
}
import { generatePresentation } from "@office-open/pptx";
const buffer = await generatePresentation({
appProperties: {
company: "Globex",
manager: "Jane Doe",
template: "report.potx",
application: "office-open",
},
slides: [
/* … */
],
});
| Property | Type | Description |
|---|---|---|
template | string | Template name |
manager | string | Manager name |
company | string | Company name |
application | string | Application name |
appVersion | string | Application version |
slides | number | Slide count |
notes | number | Notes count |
hiddenSlides | number | Hidden slide count |
totalTime | number | Total editing time (min) |
hyperlinkBase | string | Hyperlink base URL |
docSecurity | number | Document security level |
Custom Properties
customProperties are written to docProps/custom.xml. Each value is a string:
{
"customProperties": [
{ "name": "ProjectId", "value": "PRJ-42" },
{ "name": "Department", "value": "Finance" }
],
"slides": []
}
import { generatePresentation } from "@office-open/pptx";
const buffer = await generatePresentation({
customProperties: [
{ name: "ProjectId", value: "PRJ-42" },
{ name: "Department", value: "Finance" },
],
slides: [
/* … */
],
});
| Property | Type | Description |
|---|---|---|
name | string | Property name |
value | string | Property value |
Slide Sections
Group slides into named sections. Slides sharing a section name form one section in PowerPoint's navigation pane (p14:sectionLst in presentation.xml); slides without a section stay ungrouped:
{
"slides": [
{ "section": "Introduction", "children": [] },
{ "section": "Introduction", "children": [] },
{ "section": "Content", "children": [] }
]
}
import { generatePresentation } from "@office-open/pptx";
const buffer = await generatePresentation({
slides: [
{
section: "Introduction",
children: [
/* … */
],
},
{
section: "Introduction",
children: [
/* … */
],
},
{
section: "Content",
children: [
/* … */
],
},
],
});
Sections round-trip through parsePresentation — each slide's section is read back.
Presentation Settings
Set root-level attributes on the presentation (server zoom, first slide number, RTL, etc.):
{
"firstSlideNum": 1,
"rtl": false,
"autoCompressPictures": true,
"bookmarkIdSeed": 1234,
"slides": [
{
"children": [
{ "shape": { "textBody": { "children": ["Presentation with custom settings"] } } }
]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
firstSlideNum: 1,
rtl: false,
autoCompressPictures: true,
bookmarkIdSeed: 1234,
slides: [
{
children: [{ shape: { textBody: { children: ["Presentation with custom settings"] } } }],
},
],
});
Root Attributes
| Option | Type | Description |
|---|---|---|
serverZoom | string | Server zoom level |
firstSlideNum | number | First slide number |
showSpecialPlsOnTitleSld | boolean | Show placeholders on title slides |
rtl | boolean | Right-to-left layout |
removePersonalInfoOnSave | boolean | Remove personal info on save |
compatMode | boolean | Compatibility mode |
strictFirstAndLastChars | boolean | Strict first/last character rules |
embedTrueTypeFonts | boolean | Embed TrueType fonts |
saveSubsetFonts | boolean | Save font subsets |
autoCompressPictures | boolean | Auto-compress pictures |
bookmarkIdSeed | number | Bookmark ID seed |
conformance | string | "strict" or "transitional" |
Modification Protection
Protect the presentation from modification with a password. When password is provided, the SHA-512 hash with random salt and 100,000 iterations is computed automatically:
{
"modifyVerifier": {
"password": "secret"
},
"slides": [
{
"children": [{ "shape": { "textBody": { "children": ["Protected presentation"] } } }]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
modifyVerifier: {
password: "secret",
},
slides: [
{
children: [{ shape: { textBody: { children: ["Protected presentation"] } } }],
},
],
});
Modify Verifier Options
| Option | Type | Description |
|---|---|---|
password | string | Plaintext password (auto-hashed) |
algorithmName | string | Hash algorithm (default: "SHA-512") |
hashValue | string | Base64-encoded password hash |
saltValue | string | Base64-encoded salt |
spinValue | number | Spin value |
spinCount | number | Hash iterations |
cryptoProviderType | string | Cryptographic provider type |
cryptoAlgorithmClass | string | Algorithm class |
cryptoAlgorithmType | string | Algorithm type |
cryptoAlgorithmSid | number | Algorithm SID |
cryptoProvider | string | Cryptographic provider |
saltData | string | Base64-encoded salt data |
hashData | string | Base64-encoded hash data |
algorithmExtensionId | number | Algorithm extension ID |
algorithmExtensionSource | string | Algorithm extension source |
cryptoProviderTypeExtension | number | Cryptographic provider type extension |
cryptoProviderTypeExtensionSource | string | Cryptographic provider type extension source |
View Properties
Configure how the presentation appears when opened:
{
"view": {
"lastView": "slideView",
"showComments": true,
"gridSpacing": { "cx": 50800, "cy": 50800 }
},
"slides": [
{
"children": [{ "shape": { "textBody": { "children": ["Slide with view settings"] } } }]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
view: {
lastView: "slideView",
showComments: true,
gridSpacing: { cx: 50800, cy: 50800 },
},
slides: [
{
children: [{ shape: { textBody: { children: ["Slide with view settings"] } } }],
},
],
});
View Options
| Option | Type | Description |
|---|---|---|
lastView | string | Last active view ("slideView", "slideMasterView", "notesView", "handoutView", "outlineView", "slideSorterView") |
showComments | boolean | Show comments |
gridSpacing | object | Grid spacing { cx, cy } in EMU |
zoomScaleNumerator | number | Zoom scale numerator |
zoomScaleDenominator | number | Zoom scale denominator |
normalView | object | Normal view settings |
slideView | object | Slide view settings |
Normal View Options
| Option | Type | Description |
|---|---|---|
showOutlineIcons | boolean | Show outline icons |
snapVertSplitter | boolean | Snap vertical splitter |
vertBarState | string | "restored", "maximized", or "minimized" |
horzBarState | string | "restored", "maximized", or "minimized" |
preferSingleView | boolean | Prefer single view |
Slide View Options
| Option | Type | Description |
|---|---|---|
snapToGrid | boolean | Snap shapes to grid |
snapToObjects | boolean | Snap to objects |
showGuides | boolean | Show guides |
varScale | boolean | Variable scale |
Show, Web, and Print Properties
Configure slide show, web publishing, and print settings:
{
"show": {
"type": "present",
"showNarration": true,
"useTimings": true
},
"web": {
"showAnimation": true,
"resizeGraphics": true
},
"print": {
"printWhat": "handouts4",
"colorMode": "color"
},
"slides": [
{
"children": [{ "shape": { "textBody": { "children": ["Full presentation properties"] } } }]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
show: {
type: "present",
showNarration: true,
useTimings: true,
},
web: {
showAnimation: true,
resizeGraphics: true,
},
print: {
printWhat: "handouts4",
colorMode: "color",
},
slides: [
{
children: [{ shape: { textBody: { children: ["Full presentation properties"] } } }],
},
],
});
Show Options
| Option | Type | Description |
|---|---|---|
type | string | "present", "kiosk", or "browse" |
loop | boolean | Loop continuously |
showScrollbar | boolean | Show scrollbar in browse mode |
slideRange | object | Slide range { start, end } (1-based) |
restart | number | Auto-restart timeout (ms) for kiosk mode |
showNarration | boolean | Play narration during slide show |
showAnimation | boolean | Play animations during slide show |
useTimings | boolean | Use recorded timings |
penColor | string | Laser pointer color (hex) |
Web Options
| Option | Type | Description |
|---|---|---|
showAnimation | boolean | Show animations in web |
resizeGraphics | boolean | Resize graphics |
allowPng | boolean | Allow PNG images |
relyOnVml | boolean | Rely on VML |
organizeInFolders | boolean | Organize in folders |
useLongFilenames | boolean | Use long filenames |
imageSize | string | Image size |
encoding | string | Character encoding |
color | string | Color mode |
Print Options
| Option | Type | Description |
|---|---|---|
printWhat | string | What to print ("slides", "handouts1", "handouts2", "handouts3", "handouts4", "handouts6", "handouts9", "notes", "outline") |
colorMode | string | "color", "gray", or "blackWhite" |
hiddenSlides | boolean | Print hidden slides |
scaleToFitPaper | boolean | Scale to fit paper |
frameSlides | boolean | Frame slides |
HTML Publishing
Configure HTML publishing properties for web output:
{
"htmlPublish": {
"showSpeakerNotes": true,
"title": "Published Slides",
"rId": "rId1"
},
"slides": [
{
"children": [{ "shape": { "textBody": { "children": ["HTML publish demo"] } } }]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
htmlPublish: {
showSpeakerNotes: true,
title: "Published Slides",
rId: "rId1",
},
slides: [
{
children: [{ shape: { textBody: { children: ["HTML publish demo"] } } }],
},
],
});
HTML Publish Options
| Option | Type | Description |
|---|---|---|
showSpeakerNotes | boolean | Include speaker notes |
title | string | Published presentation title |
rId | string | Relationship ID |
Photo Album
Create photo album presentations with layout and frame options:
{
"photoAlbum": {
"showCaptions": true,
"layout": "2pic",
"frame": "frameStyle1"
},
"slides": [
{
"children": [{ "shape": { "textBody": { "children": ["Photo Album"] } } }]
}
]
}
import { generatePresentation } from "@office-open/pptx";
generatePresentation({
photoAlbum: {
showCaptions: true,
layout: "2pic",
frame: "frameStyle1",
},
slides: [
{
children: [{ shape: { textBody: { children: ["Photo Album"] } } }],
},
],
});
Photo Album Options
| Option | Type | Description |
|---|---|---|
blackWhite | boolean | Black and white mode |
showCaptions | boolean | Show captions under pictures |
layout | string | "fitToSlide", "1pic", "2pic", "4pic", "1picTitle", "2picTitle", "4picTitle" |
frame | string | "frameStyle1" through "frameStyle7", or "none" |