PPTX
Presentation Properties
Configure presentation-level settings, view properties, photo albums, and modification protection
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 { Presentation, Shape, Packer } from "@office-open/pptx";
const pres = new Presentation({
firstSlideNum: 1,
rtl: false,
autoCompressPictures: true,
bookmarkIdSeed: 1234,
slides: [
{
children: [
new Shape({
textBody: { text: "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"] } } }]
}
]
}
const pres = new Presentation({
modifyVerifier: {
password: "secret",
},
slides: [
{
children: [
new Shape({
textBody: { text: "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"] } } }]
}
]
}
const pres = new Presentation({
view: {
lastView: "slideView",
showComments: true,
gridSpacing: { cx: 50800, cy: 50800 },
},
slides: [
{
children: [new Shape({ textBody: { text: "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"] } } }]
}
]
}
const pres = new Presentation({
show: {
type: "present",
showNarration: true,
useTimings: true,
},
web: {
showAnimation: true,
resizeGraphics: true,
},
print: {
printWhat: "handouts4",
colorMode: "color",
},
slides: [
{
children: [new Shape({ textBody: { text: "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"] } } }]
}
]
}
const pres = new Presentation({
htmlPublish: {
showSpeakerNotes: true,
title: "Published Slides",
rId: "rId1",
},
slides: [
{
children: [new Shape({ textBody: { text: "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"] } } }]
}
]
}
const pres = new Presentation({
photoAlbum: {
showCaptions: true,
layout: "2pic",
frame: "frameStyle1",
},
slides: [
{
children: [new Shape({ textBody: { text: "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" |