Editing API

Edit PPTX slides, shapes, text, and tables on a server or in an open editor.

Use @pptx-editor.dev/editor-api to automate a presentation with a typed, batching object model. The package implements a documented subset of the Office.js presentation API. It runs on the PPTX Editor engine and does not require an add-in host.

The package uses the EigenPal Pro License. Evaluation is permitted. Production use requires a commercial agreement.

Install the package

Install the API and its engine peer:

npm install @pptx-editor.dev/editor-api @pptx-editor.dev/core

Edit and save a presentation

This Node.js example adds a title to the first slide of deck.pptx:

import { readFile, writeFile } from 'node:fs/promises';
import { PptxEditor } from '@pptx-editor.dev/editor-api';

const runtime = await PptxEditor.createServer(await readFile('deck.pptx'));
try {
  await runtime.run(async (context) => {
    const slide = context.presentation.slides.getItemAt(0);
    const title = slide.shapes.addTextBox('Quarterly results', {
      left: 40,
      top: 40,
      width: 400,
    });
    title.textFrame.textRange.font.bold = true;
    await context.sync();
  });
  await writeFile('edited.pptx', await runtime.save());
} finally {
  runtime.dispose();
}

Calls queue until context.sync(). Load properties before reading them, then synchronize before using their values. Always synchronize pending writes before returning from run().

Choose a guide

TaskGuide
Open bytes or attach to an editorRuntime and lifecycle
Read values and recover from refusalsBatching, loading, and errors
Add slides and shapesSlides and shapes
Replace and format textText and ranges
Populate and format cellsTables
Export previews and set picture fillsPictures
Find types and related membersAPI member directory

See also