Export a presentation
Build PPTX bytes when saving or downloading the edited presentation.
Download the edited file
Add this function to the editor script and call it from your Download button. Call bytes() when saving, not after every edit: it builds the PPTX archive on demand.
TypeScript
function download() {
const bytes = session.artifact.bytes();
const blob = new Blob([Uint8Array.from(bytes).buffer], {
type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
});
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = 'presentation.pptx';
link.click();
setTimeout(() => URL.revokeObjectURL(url), 1000);
}Svelte
<button onclick={download}>Download</button>For server storage, send the returned Uint8Array through your upload flow instead. Edits remain in memory until you save them.