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

@paperjsx/json-to-pptx-pro

v0.0.4

Published

PaperJSX Pro PPTX engine — templates, HarfBuzz, ChartEx, SmartArt, canvas preview

Readme

@paperjsx/json-to-pptx-pro

Commercial PowerPoint generation engine. Renders production-grade .pptx from JSON or TypeScript with the full PaperJSX rendering surface — 140+ shapes, 15 chart types, HarfBuzz text shaping, .potx template ingestion, canvas previews, and a commercial self-hosting license.

npm

npm install @paperjsx/json-to-pptx-pro

Requires Node.js >=18 and a valid PAPERJSX_LICENSE_KEY. ESM only.

Quick Start

import { createEngine } from "@paperjsx/json-to-pptx-pro";
import { writeFileSync } from "node:fs";

const pptx = createEngine({
  licenseKey: process.env.PAPERJSX_LICENSE_KEY,
});

const buffer = await pptx.render({
  type: "Document",
  meta: { title: "Board Review" },
  slides: [
    {
      type: "Slide",
      style: { padding: 40 },
      children: [
        {
          type: "Text",
          content: "Board Review",
          style: { fontSize: 30, fontWeight: "bold", color: "#0F172A" },
        },
        {
          type: "Text",
          content: "ARR is up 41% year over year.",
          style: { marginTop: 12, fontSize: 18, color: "#334155" },
        },
      ],
    },
  ],
});

writeFileSync("board-review.pptx", buffer);

Fonts and Layout Drift

Embed your fonts or accept metric drift.

Text measurement controls wrapping, pagination, and chart-label fit. If the render host measures one font and the recipient opens the deck with a substituted font, layout can drift. The safest production path is to load or embed the exact fonts you expect viewers to use.

import { createEngine, loadFont } from "@paperjsx/json-to-pptx-pro";
import { readFileSync, writeFileSync } from "node:fs";

loadFont("Inter", readFileSync("./fonts/Inter-Regular.ttf"));

const pptx = createEngine({
  licenseKey: process.env.PAPERJSX_LICENSE_KEY,
});

const doc = {
  type: "Document",
  meta: { title: "Font-safe board review" },
  slides: [
    {
      type: "Slide",
      children: [
        {
          type: "Text",
          content: "Measured with Inter",
          style: { fontFamily: "Inter", fontSize: 28, color: "#0F172A" },
        },
      ],
    },
  ],
};

const buffer = await pptx.render(doc);
writeFileSync("font-safe-board-review.pptx", buffer);

If you need a safe no-embed default for Linux/LibreOffice-heavy environments, prefer Liberation Sans or DejaVu Sans.

What's in Pro

Everything in the free @paperjsx/json-to-pptx plus:

  • 140+ shapes — full DrawingML preset library, custom geometry, connectors with rooted endpoints.
  • 15 chart types — including waterfall, funnel, sunburst, treemap, boxplot, combo, radar, bubble, stock. All editable in PowerPoint with embedded Excel data.
  • HarfBuzz text shaping — complex scripts (Arabic, Hebrew, Devanagari, Thai), RTL, OpenType features, emoji, full ligature support.
  • Template ingestion — load .potx files, extract slide masters/layouts, mutate placeholders, and preserve corporate theming end-to-end.
  • Canvas preview rendering — generate PNG thumbnails for every slide without opening PowerPoint.
  • Font subsetting — embed only the glyphs used, cutting payload size by 80–95%.
  • Quality reporting — structural validation, accessibility hints, compatibility analysis, repair helpers.
  • Commercial license — production use, self-hosting, redistribution in proprietary products.

See paperjsx.com/pricing for tiers and hosted-runtime options.

Architecture

Multi-stage render pipeline with per-request isolation:

validate (Zod) → layout (Yoga flex) → typography (fontkit + HarfBuzz)
  → OOXML serialize (DrawingML, chart XML, embedded workbooks)
  → ZIP assemble (jszip)

Every render runs inside an AsyncLocalStorage-scoped RenderContext, so concurrent renders never share mutable state. SSRF protection covers IPv4/IPv6 private ranges, DNS rebinding, and scheme allowlisting before any remote asset is fetched. Resource ceilings (MAX_TOTAL_NODES=50,000, MAX_NESTING_DEPTH=20, data-URL size cap 50MB) bound any single render.

Public API

// Engine
createEngine({ licenseKey })
PaperEngine.render(doc, options?)
RenderContext, withContext

// Validation
PaperDocumentSchema, PaperSlideSchema, PaperNodeSchema
AgentDocumentSchema, AgentSlideSchema

// Templates (pro)
loadTemplate(buffer)
mutateTemplate(template, mutations)

// Preview (pro)
renderSlidePreview(slide, { width, height, format: "png" | "jpeg" })

// Quality (pro)
runQualityReport(buffer)
repairPresentation(buffer)

// Layout & typography
runLayout(node, containerSize)
calculateTextMetrics(text, style)
shapeText(runs, { script, direction })

// Semantic compiler
compileAgentDocument(agentDoc, options?)
compileAgentSlide(agentSlide)
validateAgentDocumentLayout(paperDoc)

// Determinism
setDeterministicMode(true)

The agent compiler now accepts top-level coupled controls in designTokens (scale, density, shape) plus compileAgentDocument(..., { layoutValidation: "warn" | "error" | "off" }) for a synchronous pre-render sanity pass. Built-in presets now include the modern preset family: midnight, terminal, and editorial-wide.

Full type surface in dist-pro/index.d.ts.

License Validation

const pptx = createEngine({
  licenseKey: process.env.PAPERJSX_LICENSE_KEY,
});

The key is validated against the embedded public key on first render. Invalid, expired, or missing keys throw PaperJSXLicenseError with a remediation message. Self-hosted deployments can pin to a specific offline key; hosted deployments rotate automatically.

Keys are provisioned at paperjsx.com/dashboard. Do not commit PAPERJSX_LICENSE_KEY to source control — load it from your secret store.

Package Choice

| Package | License | Production use | | -------------------------------- | ---------- | -------------------------------------- | | @paperjsx/json-to-pptx | Apache-2.0 | Free / evaluation / open-source apps | | @paperjsx/json-to-pptx-pro | Commercial | Production, self-hosted, closed-source |

The APIs are identical. Migrating is a one-line import change once you have a license key.

Determinism

import { setDeterministicMode } from "@paperjsx/json-to-pptx-pro";
setDeterministicMode(true);

Freezes timestamps, relationship IDs, and cache seeds so the same document produces byte-identical output. Use for snapshot tests, content-addressable storage, and reproducible builds.

Error Handling

import {
  PaperError,
  PaperJSXFeatureError,
  PaperJSXLicenseError,
} from "@paperjsx/json-to-pptx-pro";

try {
  await pptx.render(doc);
} catch (err) {
  if (err instanceof PaperJSXLicenseError) { /* invalid/expired key */ }
  else if (err instanceof PaperJSXFeatureError) { /* feature not in tier */ }
  else if (err instanceof PaperError) {
    console.error(err.code, err.phase, err.message);
  }
  throw err;
}

Links

License

Commercial. See the packaged LICENSE file. A valid PAPERJSX_LICENSE_KEY is required for production use.