Skip to main content

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.

NameDescription
titletitle shown in PowerPoint UI
authorpresentation author
subjectpresentation subject
companycompany name
revisionrevision number (as string)

Library Version​

💡 You can also check the current PptxGenJS library version using the read-only version property

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 NameDefaultLayout Slide Size
LAYOUT_16x9Yes10 x 5.625 inches
LAYOUT_16x10No10 x 6.25 inches
LAYOUT_4x3No10 x 7.5 inches
LAYOUT_WIDENo13.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.

OptionTypeDefaultDescription
langstring'ja-JP'language tag for the kinsoku rule set
invalStCharsstringja-JP default setcharacters not allowed to start a line
invalEndCharsstringja-JP default setcharacters 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.

OptionTypeDefaultDescription
blackWhitebooleanfalserender album images in black & white (bw attribute)
showCaptionsbooleanfalseshow captions below album images (showCaptions attribute)
layoutstring(unset)album page layout: fitToSlide, 1pic, 2pic, 4pic, 1picTitle, 2picTitle, 4picTitle
framestring(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".

OptionTypeRequiredDescription
familystringyesfont family name (matched against your text fonts)
regularstringyesregular (normal) face — path or data
boldstringnobold face — path or data
italicstringnoitalic face — path or data
boldItalicstringnobold-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.

OptionTypeRequiredDescription
backgroundstringnobackground fill color (hex, e.g. "FFFFFF"); omitted → theme default
headerFooterobjectno{ 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,
},
});