For AI agents: the complete documentation index is available at /pptxgenjs-plus/llms.txt, the full documentation bundle is available at /pptxgenjs-plus/llms-full.txt, and this page is available as Markdown at /pptxgenjs-plus/usage-pres-options.md.

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

Custom layouts of any size are supported.

  • Use the defineLayout() method to create a custom layout of any size
  • Multiple layouts are supported. For example, define both an 'A3' and an 'A4' layout, then apply whichever is required

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';

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. Set the RTL mode presentation property to enable it.

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

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

Font embedding is opt-in. The default write path embeds nothing: no ppt/fonts/*.fntdata parts, no fntdata content type, and no Presentation font relationships.

Call addFont with a font file you are licensed to embed. This library ships no fonts. Conversion uses a vendored MIT subset of fonteditor-core; orchestration follows MIT pptx-embed-fonts.

await pptx.addFont({
  fontFace: "IBM Plex Sans",
  fontFile: ttfBuffer, // ArrayBuffer you supply
  fontType: "ttf", // ttf | otf | woff | eot
});
pptx.addSlide().addText("Hello", { fontFace: "IBM Plex Sans", fontSize: 24 });