
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@jvmr/pptx-to-html
Advanced tools
A TypeScript-based library for parsing PowerPoint (PPTX) with browser support
Convert PowerPoint (.pptx) files into HTML slides using TypeScript. The library parses the OOXML structures inside a presentation and renders each slide as a self-contained HTML snippet with absolutely positioned elements.
Based on the ISO/IEC 29500:2012 "Office Open XML File Formats - Fundamentals And Markup Language Reference".
With npm:
npm install @jvmr/pptx-to-html
Import library:
import { pptxToHtml } from "@jvmr/pptx-to-html";
import { pptxToHtml } from "@jvmr/pptx-to-html";
async function handleFile(file: File) {
const arrayBuffer = await file.arrayBuffer();
const slidesHtml = await pptxToHtml(arrayBuffer, {
width: 960,
height: 540,
scaleToFit: true,
letterbox: true,
});
const container = document.getElementById("slides")!;
container.innerHTML = slidesHtml.join("\n");
}
document.getElementById("file")!.addEventListener("change", (event) => {
const input = event.target as HTMLInputElement;
if (input.files?.[0]) {
void handleFile(input.files[0]);
}
});
In Node, there is no built-in DOMParser. Provide one via domParserFactory or install a DOM parser in your app such as @xmldom/xmldom.
npm install @xmldom/xmldom
import { readFile } from "node:fs/promises";
import { DOMParser } from "@xmldom/xmldom";
import { pptxToHtml } from "@jvmr/pptx-to-html";
async function main() {
const file = await readFile("./example.pptx");
const slidesHtml = await pptxToHtml(file.buffer, {
width: 960,
height: 540,
scaleToFit: true,
domParserFactory: () => new DOMParser(),
});
console.log(slidesHtml.join("\n\n"));
}
void main();
pptxToHtml(buffer, config?) => Promise<string[]>buffer: ArrayBuffer containing the .pptx file contents.| Option | Type | Default | Description |
|---|---|---|---|
width | number | PPT base width or 960 | Target container width in pixels |
height | number | PPT base height or 540 | Target container height in pixels |
scaleToFit | boolean | false | Scales the slide viewport into the target container |
letterbox | boolean | true when scaleToFit is true | Preserves aspect ratio with bars instead of stretching |
domParserFactory | () => { parseFromString(xml: string, mime: string): Document } | undefined | Optional parser factory for Node environments |
Notes:
ppt/presentation.xml (sldSz). When unavailable, it defaults to 960x540.EMU / 9525).domParserFactory, or by installing a parser such as @xmldom/xmldom. The library also attempts a best-effort require("@xmldom/xmldom") when available.MIT
FAQs
A TypeScript-based library for parsing PowerPoint (PPTX) with browser support
We found that @jvmr/pptx-to-html demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.