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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kandiforge/pptx-renderer

v3.2.19

Published

PPTX renderer for React with canvas-based slide rendering and filmstrip navigation

Downloads

1,061

Readme

@abstractclass/pptx-renderer

Proprietary PPTX renderer for React with canvas-based slide rendering and filmstrip navigation

Copyright © 2025 AbstractClass, Inc. All rights reserved.

PROPRIETARY AND CONFIDENTIAL - This software is licensed under a proprietary license. See LICENSE for details.

Overview

A high-performance, browser-based PowerPoint (PPTX) renderer built with React and HTML5 Canvas. Renders slides client-side without requiring server-side processing or LibreOffice conversion.

Key Features

  • Client-Side Rendering: No server processing required
  • Fast Performance: Instant rendering, <50ms per slide
  • Filmstrip Navigation: Built-in thumbnail TOC with customizable position
  • Theme Support: Full theme color and font parsing
  • Rich Formatting: Text, images, shapes, colors, alignment
  • TypeScript: Fully typed API
  • Responsive: Dynamic canvas sizing with high-DPI support

Installation

npm install @abstractclass/pptx-renderer

Or with yarn:

yarn add @abstractclass/pptx-renderer

Quick Start

Basic Usage

import { PptxRenderer } from '@abstractclass/pptx-renderer';

function MyApp() {
  return (
    <PptxRenderer
      pptxSource="/path/to/presentation.pptx"
      initialSlide={0}
      width={960}
      height={540}
      showFilmstrip={true}
      filmstripPosition="right"
      onSlideChange={(slideNumber) => {
        console.log('Slide changed to:', slideNumber);
      }}
    />
  );
}

With File Upload

import { PptxRenderer } from '@abstractclass/pptx-renderer';
import { useState } from 'react';

function SlideUploader() {
  const [file, setFile] = useState<File | null>(null);

  return (
    <div>
      <input
        type="file"
        accept=".pptx"
        onChange={(e) => setFile(e.target.files?.[0] || null)}
      />

      {file && (
        <PptxRenderer
          pptxSource={file}
          width={1280}
          height={720}
          showFilmstrip={true}
          filmstripPosition="right"
        />
      )}
    </div>
  );
}

Advanced Usage - Direct Slide Rendering

import { parsePPTX, SlideRenderer } from '@abstractclass/pptx-renderer';

async function renderSlideManually() {
  // Parse PPTX file
  const response = await fetch('/path/to/presentation.pptx');
  const arrayBuffer = await response.arrayBuffer();
  const pptxData = await parsePPTX(arrayBuffer);

  // Get canvas element
  const canvas = document.getElementById('myCanvas') as HTMLCanvasElement;

  // Create renderer with high-DPI support
  const renderer = new SlideRenderer(canvas, {
    width: 960,
    height: 540,
    scale: window.devicePixelRatio,
  });

  // Render first slide
  await renderer.renderSlide(pptxData.slides[0]);
}

API Reference

<PptxRenderer>

Main component for rendering PPTX files with filmstrip navigation.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | pptxSource | File \| string \| ArrayBuffer | - | PPTX file source | | initialSlide | number | 0 | Initial slide to display (0-indexed) | | width | number | 960 | Canvas width in pixels | | height | number | 540 | Canvas height in pixels | | showFilmstrip | boolean | true | Show filmstrip navigation | | filmstripPosition | 'left' \| 'right' \| 'bottom' | 'right' | Position of filmstrip | | onSlideChange | (slideNumber: number) => void | - | Callback when slide changes | | onError | (error: Error) => void | - | Callback for errors | | slides | SlideData[] | - | Optional pre-parsed slides | | deckData | DeckData | - | Optional deck data with theme | | allowReorder | boolean | false | Enable slide reordering | | allowDelete | boolean | false | Enable slide deletion | | showControls | boolean | false | Show slide controls |

parsePPTX(arrayBuffer: ArrayBuffer): Promise<PPTXData>

Parse a PPTX file from an ArrayBuffer.

Returns: Promise resolving to parsed PPTX data including slides, theme, and metadata.

SlideRenderer

Low-level canvas renderer for individual slides.

const renderer = new SlideRenderer(canvas, {
  width: 960,
  height: 540,
  scale: 2, // For retina displays
});

await renderer.renderSlide(slideData);

parseTheme(themeXml: string): PPTXTheme

Parse theme XML to extract colors and fonts.

parseSlideXml(slideXml: string, theme: PPTXTheme): ParsedSlide

Parse slide XML to extract shapes, text, and formatting.

Supported Features

Currently Supported

  • ✅ Text boxes with formatting (font, size, color, bold, italic)
  • ✅ Text alignment (left, center, right)
  • ✅ Theme colors and fonts
  • ✅ Images (PNG, JPEG, embedded)
  • ✅ Rectangles and shapes with fill/stroke
  • ✅ Solid color backgrounds
  • ✅ Bullets and paragraphs
  • ✅ Master slides and layouts
  • ✅ Placeholder inheritance

Not Yet Supported

  • ❌ Charts/Graphs
  • ❌ Tables
  • ❌ SmartArt
  • ❌ Complex gradients
  • ❌ Animations
  • ❌ Transitions
  • ❌ Videos
  • ❌ Custom fonts (uses fallback fonts)

Architecture

PPTX File
    ↓
pptxtojson (XML parser)
    ↓
Theme & Slide XML
    ↓
pptx-xml-parser (our parser)
    ↓
Slide Data (structured JSON)
    ↓
SlideRenderer (canvas drawing)
    ↓
HTML5 Canvas

Performance

  • Parsing: ~100-500ms for typical PPTX files
  • Rendering: <50ms per slide
  • Memory: ~5-10MB per presentation
  • Scales: Tested with presentations up to 100 slides

Much faster than server-side approaches (LibreOffice, etc.) with no file I/O overhead.

Browser Support

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Requires HTML5 Canvas support with high-DPI rendering.

TypeScript

Fully typed with TypeScript. All components and functions include comprehensive type definitions.

import type {
  PptxRendererProps,
  SlideData,
  DeckData,
  PPTXTheme,
} from '@abstractclass/pptx-renderer';

Examples

See the examples/ directory for complete working examples:

  • examples/basic/ - Basic usage with URL source
  • examples/with-filmstrip/ - Filmstrip navigation
  • examples/advanced/ - Advanced rendering with custom controls

License

PROPRIETARY AND CONFIDENTIAL

Copyright © 2025 AbstractClass, Inc. All rights reserved.

This software and associated documentation files are proprietary to AbstractClass, Inc. Unauthorized copying, distribution, or use is strictly prohibited.

See LICENSE file for complete terms.

For licensing inquiries, contact: [email protected]

Support

For support and inquiries:

Changelog

See CHANGELOG.md for version history and release notes.


Built with ❤️ by AbstractClass, Inc.