microscope-js - v0.0.0
    Preparing search index...

    Module @microscope-js/renderer-pptx

    @microscope-js/renderer-pptx

    npm Bundle Types Provenance

    PowerPoint .pptx renderer for microscope-js. Reads the OOXML archive with JSZip, extracts the text runs from each slide*.xml, and renders them as paginated slides. Lightweight text view — no full OOXML layout engine.

    pnpm add @microscope-js/renderer-pptx
    
    import { createRegistry, mount } from '@microscope-js/core';
    import { pptxRenderer } from '@microscope-js/renderer-pptx';

    const registry = createRegistry([pptxRenderer]);
    const handle = await mount({ source: file, container, registry });

    const cap = handle.capabilities as { slideCount: number; goToSlide(n: number): void };
    console.log(cap.slideCount);
    cap.goToSlide(3);
    Option Default Description
    maxBytes 128 * 1024 * 1024 Reject .pptx files larger than this
    maxUncompressed 512 * 1024 * 1024 Total uncompressed cap — zip-bomb defense
    interface PptxHandle extends RenderHandle {
    readonly capabilities: {
    slideCount: number;
    goToSlide(n: number): void;
    };
    }

    Rendering OOXML pixel-perfect requires a complete shape + layout + font + image engine — usually ~2 MB of code and a long maintenance tail. This package goes the other way: it keeps the bundle tiny, leans on the browser for typography, and surfaces the content users actually want to read. If you need exact visual fidelity, pair this with a server-side preview pipeline (LibreOffice, OnlyOffice, etc.) for that one workflow.

    Pixel-perfect rendering is on the roadmap as an opt-in package.

    • Every archive entry path is run through assertSafeZipEntry() before extraction — .. segments and absolute paths are rejected (CWE-22, zip-slip).
    • ByteBudget caps total uncompressed bytes — defends against zip bombs (a 1 KB zip that expands to 4 GB).
    • Slide HTML is passed through sanitizeHtml before being inserted.
    • All rendering is in-browser. The deck never leaves the tab.

    MIT

    Interfaces

    PptxHandle
    PptxOptions

    Variables

    pptxRenderer

    References

    default → pptxRenderer