Skip to main content
The facade is the same in a page. Two things change: there is no file system, and you supply the fonts.

Edit only

If you only edit and save, import from @reductoai/pptx/officejs. It needs no fonts and no layout.

Lay out and render

To paint a deck in a page, lay out its bytes with runPptxPipeline from @reductoai/pptx/browser. Give the registry the faces first:
After an edit, call deck.toBytes() and lay out those bytes. Layout of a large deck takes time; run it in a module Web Worker so the page stays responsive.

EMF, WMF and SVG pictures

Node renders these natively. A page needs a rasterizer, for example @resvg/resvg-wasm. Install the backend once, before the first layout:
Chart SVGs name their fonts, so route SVG pictures through the backend: it fetches the faces each picture names. Without a backend, EMF and WMF pictures show as empty boxes. To keep large pictures off the page thread, also pass spawnWorker and serve the worker with serveMetafileRaster (same options as renderSvg).

Differences from Node