Export presentations
Save PPTX files, export slide images in the browser, or create PDFs on a server.
Choose an export format for your workflow:
| Output | API | Environment |
|---|---|---|
| Editable PPTX | editor.save() | Browser editor |
| One PNG | exportSlidePng() | Browser |
| One SVG | exportSlideSvg() | Browser |
| PNG files in ZIP | exportSlidesPngZip() | Browser |
@pptx-editor.dev/pptx-to-pdf | Node.js |
For PPTX downloads and storage, see Load and save presentations. PDF conversion uses the EigenPal Pro License. Evaluation is permitted. Production use requires a commercial agreement.
Export the current slide as PNG
Image export takes the session from a PptxEditorInstance. This function returns a Blob for your download or upload code:
import { exportSlidePng, type PptxEditorInstance } from '@pptx-editor.dev/core/editor';
export async function currentSlidePng(editor: PptxEditorInstance) {
if (!editor.save()) {
throw new Error('The presentation cannot be exported.');
}
const session = editor.session;
if (!session) throw new Error('No presentation is open.');
return exportSlidePng(session, editor.snapshot().currentSlide, {
width: 1920,
});
}The save check completes pending parsing and detects damaged slides before export. It serializes the presentation but does not download it.
The width defaults to 1920 pixels. It must be from 16 to 8192 pixels. The height follows the slide ratio and cannot exceed 8192 pixels.
Export SVG or a ZIP archive
Use the same session for either format:
import {
exportSlideSvg,
exportSlidesPngZip,
type PptxEditorInstance,
} from '@pptx-editor.dev/core/editor';
export async function slideAssets(editor: PptxEditorInstance) {
if (!editor.save()) throw new Error('Export is unavailable.');
const session = editor.session;
if (!session) throw new Error('No presentation is open.');
const slide = editor.snapshot().currentSlide;
// EMF and WMF pictures convert in the background. Wait for this slide's.
if (!(await session.picturesReady(slide))) {
// A picture that did not convert exports as a placeholder.
const missing = session.pictureStatus(slide).filter((p) => p.state !== 'ready');
console.warn('Pictures that export as placeholders:', missing);
}
const svg = exportSlideSvg(session, slide);
const zip = await exportSlidesPngZip(session, { width: 1280 });
return { svg, zip };
}SVG export returns a string. ZIP export returns bytes with numbered files such as slide-01.png.
EMF and WMF pictures
The editor converts EMF and WMF pictures to PNG in the background. A picture shows a placeholder until its PNG is ready.
exportSlideSvg()is synchronous. Awaitsession.picturesReady(index)before you call it.- PNG and ZIP export wait for the pictures of each slide for up to 30 seconds. Set
picturesTimeoutMsto change that limit for each slide. session.picturesReady(index?, { timeoutMs, retry })resolvestruewhen every picture draws. Omitindexto wait for every slide.- It resolves
falsewhen a picture cannot convert, when the slide does not exist, or aftertimeoutMs(default 30000). PassInfinityto wait until each picture converted or failed. A picture istimed-outafter two tries of 10 seconds each. Passretry: trueto convert it again. session.pictureStatus(index?)lists the pictures with their states:ready,pending,failed, ortimed-out. Use it to learn which picture exports as the placeholder. A picture of a slide that nothing painted or waited for stayspending:picturesReadystarts its conversion.
The editor repaints when pictures convert, and editor.subscribe() listeners hear a new snapshot. A picture that is not ready exports as the placeholder. After a font change, it exports as its last converted version until the new one is ready.
Catch export errors in your UI. Use PNG when you need a fixed raster image. SVG font embedding follows font permissions; another viewer can substitute unavailable fonts.
Export PDF
Save the edited PPTX bytes and pass them to your server. Follow PDF export for conversion, font configuration, and error handling.
Keep the PDF package in server code. The browser editor and server converter use the same engine layout.