API reference
Every public export of @office-kit/pptx and @office-kit/pptx/node,
by category. The library is functions only, with no classes. This page covers the 277
exports people reach for most, in 18 groups; the package's type declarations
list every one.
For the conceptual map see the API overview. For code you can paste, see the cheatsheet and recipes.
Load / save
Open and persist a .pptx, plus the Node fs convenience subpath.
loadPresentation(input: Uint8Array | ArrayBuffer | Blob) => Promise<PresentationData>savePresentation(pres: PresentationData) => Promise<Uint8Array>createPresentation() => PresentationDataloadPresentationFile(path: string) => Promise<PresentationData> — @office-kit/pptx/nodesavePresentationToFile(pres: PresentationData, path: string) => Promise<void> — @office-kit/pptx/node
Units
Branded Emu constructors. Internal code only sees Emu — every numeric position is type-checked at the boundary.
Slides
Enumerate, add, remove, reorder. Layouts come from the loaded template.
Slide layouts
Inspect and switch slides between the layouts shipped by the deck's masters.
Slide metadata
Title, size, visibility, sections, background, transitions, speaker notes.
getSlideTitlesetSlideTitlegetSlideSizesetSlideSizeisSlideHiddensetSlideHiddengetSlideSectionssetSlideSectionsgetSlideBackgroundsetSlideBackgroundsetSlideBackgroundImageclearSlideBackgroundgetSlideNotessetSlideNotesappendSlideNotesremoveSlideNotesgetSlideTransitionsetSlideTransitionclearSlideTransition
Placeholders & text
Find placeholders by type, replace tokens, set per-run / per-paragraph formatting.
findSlidePlaceholderfindSlidePlaceholderByIdxfindSlidePlaceholdersfindEmptyPlaceholderssetSlidePlaceholderssetSlideBodygetSlideBodyreplaceTokensInPresentationreplaceTokensInSlidereplaceTextInPresentationreplaceTextInSlidereplaceTextInNotesreplaceTextInSlideNotessetShapeTextappendShapeTextsetShapeRunTextsetShapeRunFormatsetShapeTextFormatsetParagraphAlignmentsetParagraphLevelsetParagraphBulletsetParagraphSpacingsetShapeBulletStylesetShapeAlignmentsetShapeTextAnchorsetShapeTextMarginssetShapeTextWrapsetShapeTextAutoFit
Shapes
Add, find, mutate, remove shapes. 180+ preset geometries.
addSlideShapeaddSlideTextBoxaddSlideLineaddSlideImageaddSlideTableaddSlideChartaddSlideCommentgetSlideShapesgetShapeAtgetAllShapesfindShapeByIdfindShapeByNamefindShapeByTextfindShapesByKindfindShapesByNamefindShapesByTextfindShapesAtPointfindShapesOutsideCanvasfindFlippedShapesfindOverlappingShapePairsfindShapeInPresentationcopyShaperemoveShaperenameShapeclearSlideShapes
Shape geometry
Position, size, rotation, flip, z-order.
getShapePositionsetShapePositiongetShapeSizesetShapeSizegetShapeBoundssetShapeBoundsgetShapesBoundstranslateShapescenterShapeOnSlidegetShapeCentergetShapeRotationsetShapeRotationgetShapeFlipsetShapeFlipgetShapeZIndexsetShapeZIndexbringShapeToFrontsendShapeToBackbringShapeForwardsendShapeBackward
Fill, stroke, effects
Solid / gradient / pattern / image fill + stroke + shadow / glow.
getShapeFillsetShapeFillsetShapeGradientFillsetShapePatternFillsetShapeImageFillsetShapeNoFillclearShapeFillgetShapeFillColorgetShapeFillOpacitygetShapeStrokesetShapeStrokesetShapeStrokeDashsetShapeStrokeArrowsetShapeStrokeSketchsetShapeNoStrokeclearShapeStrokegetShapeStrokeColorgetShapeStrokeOpacitygetShapeStrokeWidthgetShapeStrokeDashgetShapeStrokeArrowgetShapeStrokeGradientgetShapeStrokeSketchgetShapeEffectsetShapeShadowsetShapeGlowclearShapeEffects
Images
Embedded picture shapes — bytes, crop, opacity, brightness, contrast.
Media
Embedded video / audio and online (URL) video — add and read back.
Tables
Per-cell text / fill / alignment, structural insert / remove, sizing.
isTableShapegetTableSizegetTableDimensionsgetTableRowHeightsgetTableColumnWidthssetTableRowHeightsetTableColumnWidthgetTableCellsgetTableCellgetTableCellTextsetTableCellTextgetTableCellPositiongetTableCellSpanmergeTableCellssplitTableCellgetTableCellFillsetTableCellFillclearTableCellFillgetTableCellAlignmentsetTableCellAlignmentsetTableCellTextFormatinsertTableRowinsertTableColumnremoveTableRowremoveTableColumn
Charts
Embedded charts with auto-generated xlsx. Kinds: bar, column, line, pie, doughnut, area.
Hyperlinks & click actions
External URL hyperlinks plus in-deck click navigation.
Animations
Entrance / exit / emphasis presets. Complex timing-tree authoring is post-1.0.
Comments
Per-slide review comments with author metadata and EMU position.
addSlideCommentremoveSlideCommentclearSlideCommentsclearAllSlideCommentsgetSlideCommentsgetAllCommentsgetCommentAuthorgetCommentAuthorsgetCommentDategetCommentPositiongetCommentSlidegetCommentTextgetCommentsSortedByDatefindCommentAuthorByNamefindCommentsAfterfindCommentsBeforefindCommentsByAuthorfindCommentsByTextgetSlideCommentAuthorsgetPresentationCommentersgetSlidesWithCommentsfindSlidesWithCommentsByAuthor
Document properties
Title, Author, Subject, Keywords, App, Company, thumbnail.
Diagnostics
Validation, raw OPC introspection, media accounting.