Presentation Options
Metadata
Metadata Properties
These optional metadata properties correspond to built-in PowerPoint document properties (visible under File > Info). They help describe the presentation’s content and ownership.
| Name | Description |
|---|---|
title | title shown in PowerPoint UI |
author | presentation author |
subject | presentation subject |
company | company name |
revision | revision number (as string) |
Library Version
💡 You can also check the current PptxGenJS library version using the read-only
versionproperty
console.log(pptx.version); // e.g. "4.0.0"
Metadata Properties Examples
PptxGenJS uses ES6-style getters/setters.
pptx.title = 'My Awesome Presentation';
pptx.author = 'Brent Ely';
pptx.subject = 'Annual Report';
pptx.company = 'Computer Science Chair';
pptx.revision = '15';
Slide Layouts (Sizes)
Layout option applies to all slides in the current Presentation.
Slide Layout Syntax
pptx.layout = 'LAYOUT_NAME';
Standard Slide Layouts
| Layout Name | Default | Layout Slide Size |
|---|---|---|
LAYOUT_16x9 | Yes | 10 x 5.625 inches |
LAYOUT_16x10 | No | 10 x 6.25 inches |
LAYOUT_4x3 | No | 10 x 7.5 inches |
LAYOUT_WIDE | No | 13.3 x 7.5 inches |
Custom Slide Layouts
You can create custom layouts of any size!
- Use the
defineLayout()method to create any size custom layout - Multiple layouts are supported. E.g.: create an 'A3' and 'A4', then use as desired
Custom Slide Layout Example
// Define new layout for the Presentation
pptx.defineLayout({ name:'A3', width:16.5, height:11.7 });
// Set presentation to use new layout
pptx.layout = 'A3';
🔍 Need to inspect the current layout size?
console.log(pptx.presLayout); // { width: 10, height: 5.625 }
Text Direction
Text Direction Options
Right-to-Left (RTL) text is supported. Simply set the RTL mode presentation property.
Text Direction Examples
pptx.rtlMode = true; // set RTL text mode to true
pptx.theme = { lang: "he" }; // set RTL language to use (default is 'EN-US')
Notes:
- You may also need to set an RTL lang value such as
lang='he'as the default lang is 'EN-US' - See Issue#600 for more
Kinsoku (East-Asian Line Breaks)
Kinsoku Options
Kinsoku rules control which characters may not start or end a line in CJK
(Chinese/Japanese/Korean) typography. Set the kinsoku presentation property to
emit a <p:kinsoku> element in presentation.xml.
| Option | Type | Default | Description |
|---|---|---|---|
lang | string | 'ja-JP' | language tag for the kinsoku rule set |
invalStChars | string | ja-JP default set | characters not allowed to start a line |
invalEndChars | string | ja-JP default set | characters not allowed to end a line |
Sensible Japanese (ja-JP) defaults are provided, so most users need only set
lang. Character lists are XML-escaped automatically. Default-off: when
kinsoku is not set, no <p:kinsoku> element is emitted.
Kinsoku Examples
// Use the built-in ja-JP defaults
pptx.kinsoku = { lang: "ja-JP" };
// Or supply custom character lists
pptx.kinsoku = {
lang: "ja-JP",
invalStChars: "!),.:;?]}…",
invalEndChars: "([{‘“",
};
Photo Album
Photo Album Options
Mark a deck as a PowerPoint photo album by setting the photoAlbum presentation
property. This emits a <p:photoAlbum> metadata element in presentation.xml so
editors expose their album layout/frame controls. The image slides are still
authored normally — this property only records the album metadata.
| Option | Type | Default | Description |
|---|---|---|---|
blackWhite | boolean | false | render album images in black & white (bw attribute) |
showCaptions | boolean | false | show captions below album images (showCaptions attribute) |
layout | string | (unset) | album page layout: fitToSlide, 1pic, 2pic, 4pic, 1picTitle, 2picTitle, 4picTitle |
frame | string | (unset) | image frame shape: frameStyle1 … frameStyle7 |
blackWhite and showCaptions are always emitted; layout and frame are
emitted only when set (their schema defaults apply otherwise). Default-off: when
photoAlbum is not set, no <p:photoAlbum> element is emitted.
Photo Album Examples
pptx.photoAlbum = {
blackWhite: false,
showCaptions: true,
layout: "fitToSlide",
frame: "frameStyle1",
};
Default Font
Default Font Options
Use the headFontFace and bodyFontFace properties to set the default font used in the presentation.
Default Font Examples
pptx.theme = { headFontFace: "Arial Light" };
pptx.theme = { bodyFontFace: "Arial" };
Embedded Fonts
Embedded Fonts Options
Embed TrueType/OpenType font files directly inside the .pptx so the deck
renders with the intended typeface even on machines that do not have the font
installed. Call pptx.embedFont(...) once per font family. This packages the
font binaries into /ppt/fonts/*.fntdata, emits a <p:embeddedFontLst> element
in presentation.xml, and sets embedTrueTypeFonts="1".
| Option | Type | Required | Description |
|---|---|---|---|
family | string | yes | font family name (matched against your text fonts) |
regular | string | yes | regular (normal) face — path or data |
bold | string | no | bold face — path or data |
italic | string | no | italic face — path or data |
boldItalic | string | no | bold-italic face — path or data |
Each face value is a filesystem path (Node), a base64 string, or a data: URI.
Only .ttf and .otf faces are supported — any other face is skipped with a
warning (a font with no valid regular face is dropped entirely). The full font
file is embedded; subsetting is not performed, so embedding several faces will
increase the file size. Default-off: when embedFont() is not called, no font
parts, relationships, or <p:embeddedFontLst> element are emitted.
Embedded Fonts Examples
pptx.embedFont({
family: "Inter",
regular: "./fonts/Inter-Regular.ttf",
bold: "./fonts/Inter-Bold.ttf",
italic: "./fonts/Inter-Italic.ttf",
boldItalic: "./fonts/Inter-BoldItalic.ttf",
});
Handout Master
Handout Master Options
Define a handout master — the layout PowerPoint uses when printing multiple
slides per page — so a deck can carry branded handout headers/footers. Call
pptx.defineHandoutMaster(...) once. This packages a
/ppt/handoutMasters/handoutMaster1.xml part and emits a <p:handoutMasterIdLst>
element in presentation.xml.
| Option | Type | Required | Description |
|---|---|---|---|
background | string | no | background fill color (hex, e.g. "FFFFFF"); omitted → theme default |
headerFooter | object | no | { header?, footer?, dateTime?, slideNumber? } handout header/footer |
Default-off: when defineHandoutMaster() is not called, no handout part,
relationship, [Content_Types].xml Override, or <p:handoutMasterIdLst>
element is emitted.
Handout Master Examples
pptx.defineHandoutMaster({
background: "FFFFFF",
headerFooter: {
header: "Internal",
footer: "Confidential",
dateTime: true,
slideNumber: true,
},
});