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/coreEdit 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
| Task | Guide |
|---|---|
| Open bytes or attach to an editor | Runtime and lifecycle |
| Read values and recover from refusals | Batching, loading, and errors |
| Add slides and shapes | Slides and shapes |
| Replace and format text | Text and ranges |
| Populate and format cells | Tables |
| Export previews and set picture fills | Pictures |
| Find types and related members | API member directory |