Presentation Options

Presentation-wide settings: author, company, layout, theme fonts, RTL mode.

0Namespaces used by the C# samples

using NetCorePpt;                  // PptxGen, Slide
using NetCorePpt.CoreInterfaces;   // option objects: TextProps* / ShapeProps / ImageProps / TableProps / HAlign / VAlign ...
using NetCorePpt.CoreEnums;        // ShapeType, ChartType, MediaType, ShadowType, BulletType, DashType, SCHEME_COLORS ...
using TableRow = System.Collections.Generic.List<NetCorePpt.CoreInterfaces.TableCell>;

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 NetCorePpt library version using the read-only version property
PptxGenJS · javascript
console.log(pptx.version); // e.g. "4.0.0"
NetCorePpt · C#
Console.WriteLine(pptx.version); // e.g. "4.0.1"

Metadata Properties Examples

Option objects are plain C# classes — set the properties you need and leave the rest at their default values.

PptxGenJS · javascript
pptx.title = 'My Awesome Presentation';
pptx.author = 'Brent Ely';
pptx.subject = 'Annual Report';
pptx.company = 'Computer Science Chair';
pptx.revision = '15';
NetCorePpt · C#
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

PptxGenJS · javascript
pptx.layout = 'LAYOUT_NAME';
NetCorePpt · C#
// LAYOUT_4x3 | LAYOUT_16x9 | LAYOUT_16x10 | LAYOUT_WIDE  (or a name you defined)
pptx.layout = "LAYOUT_16x9";

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

PptxGenJS · javascript
// 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';
NetCorePpt · C#
// Define new layout for the Presentation
pptx.defineLayout("A3", 16.5, 11.7);

// Set presentation to use new layout
pptx.layout = "A3";

// ...or define and switch in one call:
// pptx.defineLayout("A3", 16.5, 11.7, asDefaultLayout: true);
🔍 Need to inspect the current layout size?
PptxGenJS · javascript
console.log(pptx.presLayout); // { width: 10, height: 5.625 }
NetCorePpt · C#
// PresLayout exposes `width` / `height` (inches) instead of a plain JS object.
Console.WriteLine($"{pptx.presLayout.width} x {pptx.presLayout.height}"); // e.g. 10 x 5.625

Text Direction

Text Direction Options

Right-to-Left (RTL) text is supported. Simply set the RTL mode presentation property.

Text Direction Examples

NetCorePpt · C#
pptx.rtlMode = true; // set RTL text mode to true
Notes:

Default Font

Default Font Options

Use the headFontFace and bodyFontFace properties to set the default font used in the presentation.

Default Font Examples

PptxGenJS · javascript
pptx.theme = { headFontFace: "Arial Light" };
pptx.theme = { bodyFontFace: "Arial" };
NetCorePpt · C#
pptx.theme = new ThemeProps { headFontFace = "Arial Light" };
pptx.theme = new ThemeProps { bodyFontFace = "Arial" };

// Both at once (assigning `theme` replaces the whole object, same as in JS):
// pptx.theme = new ThemeProps(headFontFace: "Arial Light", bodyFontFace: "Arial");