npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@polotno/pptx-export

v0.1.1

Published

Convert Polotno JSON into PPTX file

Readme

Polotno to PPTX

Convert Polotno JSON into PowerPoint PPTX files. Works in Node.js and the browser.

The export is editable-first: text becomes real PowerPoint text runs, simple figures become native shapes, tables become native tables. Only things PPTX can't represent (complex shapes, gradients, filters, masks) are rasterized to images.

npm install @polotno/pptx-export

Usage

One import works everywhere — the package ships separate Node and browser builds and your bundler/runtime picks the right one automatically.

Browser — download the file

import { jsonToPPTX } from '@polotno/pptx-export';

const json = store.toJSON();
// triggers a "design.pptx" download
await jsonToPPTX(json, 'design.pptx');

Node.js — save the file

import fs from 'fs';
import { jsonToPPTX } from '@polotno/pptx-export';

const json = JSON.parse(fs.readFileSync('./design.json'));
await jsonToPPTX(json, 'design.pptx');

In-memory output

import { jsonToPPTXBytes, jsonToPPTXBlob } from '@polotno/pptx-export';

const bytes = await jsonToPPTXBytes(json); // Uint8Array, works everywhere
const blob = await jsonToPPTXBlob(json); // Blob, browser and Node 18+

If your tooling resolves the wrong build (or you want to be explicit), pick one directly:

import { jsonToPPTX } from '@polotno/pptx-export/node';
// or
import { jsonToPPTX } from '@polotno/pptx-export/browser';

Options

All functions accept an optional last argument:

await jsonToPPTX(json, 'design.pptx', {
  // pixels-per-inch for px → inch/pt conversion.
  // Defaults to json.dpi, then 72.
  dpi: 72,
  // supersampling factor for rasterized elements (default 2)
  rasterScale: 2,
});

Feature support

| Polotno feature | PPTX output | | --- | --- | | Text (incl. rich HTML: bold/italic/underline/strike, per-span color/font/size) | Native text runs | | Text align / vertical align / line height / letter spacing / transform | Native | | Lists (<ul>/<ol>, nesting, Quill data-list/ql-indent-N) | Native PowerPoint bullets & numbering | | Text outline, shadow, background | Native | | Figures: rect, circle, triangle, rightTriangle, diamond, pentagon, hexagon, star, cross, arrows, heart1, cloud | Native preset shapes (editable in PowerPoint) | | Other figures (blobs, decorative shapes) | Rasterized PNG | | Gradients (fill, page background) | Rasterized (PPTX has no gradient API in pptxgenjs) | | Images: crop, flip, rotation, opacity, shadow | Native | | Images: corner radius, border, filters (blur/sepia/grayscale/brightness/custom), masks | Composited to PNG | | GIF | Animated when no effects applied; otherwise static | | SVG (incl. colorsReplace) | Rasterized PNG | | Lines with arrow heads & dash | Native line shapes | | Tables (merged cells, per-cell styles & borders) | Native tables | | Video | Embedded slide media | | Groups | Children rendered with composed opacity | | Page background (color / image / gradient) | Native background | | Animations: fade / move / zoom (enter & exit) | Native effects (Fade, Fly In/Out, Zoom) that auto-play on slide entry | | Animations: rotate / blink / bounce (loop) | Approximated with repeating emphasis effects (Spin, opacity pulse, Grow/Shrink) |

Known limitations

  • Fonts are not embedded. PPTX font embedding is not supported by the underlying generator. Font names are passed through — the font must be installed on the viewing machine, or PowerPoint substitutes it.
  • Curved text renders straight (with a warning).
  • Gradient text fill renders with the first gradient stop color.
  • Per-line text background becomes a whole-box background.
  • Rotated tables render unrotated (PPTX tables can't rotate).
  • Per-page sizes are not supported by PPTX — all slides use the document size.
  • page.bleed has no PPTX equivalent and is ignored.
  • Animations play automatically on slide entry; slides still advance on click (no auto-advance from page.duration). Exit animations are scheduled at page.duration − duration − delay. cameraZoom has no PPTX equivalent and is skipped with a warning.

Development

npm run build   # build lib/index.js (Node) + lib/browser.js (browser) via tsup
npm test        # run tests
npm run dev     # start demo app at http://localhost:5173

Tests

  • Structural tests (tests/features.test.ts, tests/render.test.js) unzip the generated PPTX and assert on the slide XML. They run everywhere.
  • Visual snapshot tests (tests/pptx.test.js) convert the PPTX to PDF with LibreOffice, render PNGs and compare against baselines. They skip automatically when LibreOffice is not installed (brew install --cask libreoffice on macOS). Refresh baselines with npm run test:update-snapshots.

LibreOffice's PPTX rendering differs from PowerPoint's — visual snapshots are regression tests, not proof of PowerPoint fidelity. Spot-check important changes in PowerPoint or Keynote.