Sign In

@file-viewer/ppt

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@file-viewer/ppt

Professional native WebAssembly canvas viewer for PowerPoint 97-2003 (.ppt) files.

npmnpm
Version
0.2.0
Version published
Weekly downloads
2.2K
31.77%
Maintainers
1
Weekly downloads
 
Created
Source

@file-viewer/ppt

Professional browser preview for PowerPoint 97–2003 (.ppt), powered by native WebAssembly and Canvas.

npm version format license

English · 简体中文

English

A professional viewer for traditional PowerPoint files

@file-viewer/ppt is Flyfish's independently developed preview engine for the PowerPoint 97–2003 binary (.ppt) format. It reconstructs slides directly in a modern browser without Microsoft Office, LibreOffice, browser plug-ins, or a server-side conversion service.

The product is designed for document platforms, archives, knowledge systems, intranets, SaaS applications, and web products that still need dependable access to traditional PowerPoint files.

Product highlights

  • Native .ppt understanding — Reads the classic PowerPoint compound-file, persist-record, text, drawing, and picture structures directly.
  • Professional slide reconstruction — Handles slide size, masters, backgrounds, color schemes, text formatting, adjustable OfficeArt shapes, fills, gradients, bounded legacy 3-D extrusion, grouped objects, pictures, transforms, and layer order.
  • Native WASM Canvas pipeline — Parsing, layout, rasterization, and public watermark composition run in one WebAssembly engine. JavaScript presents the engine's final RGBA frames with Canvas.
  • Local document processing — The public runtime does not require documents to be uploaded to a conversion service.
  • Verified engine asset — The loader validates the exact native WASM SHA-256 before execution.
  • Straightforward integration — ESM, TypeScript declarations, no runtime JavaScript dependencies, and support for both complete-viewer mounting and individual-slide rendering.

Format scope

This package previews PowerPoint 97–2003 binary .ppt files. For XML-based .pptx files, use a dedicated PPTX viewer.

Installation

npm install @file-viewer/ppt

Quick start

<input id="ppt-file" type="file" accept=".ppt,application/vnd.ms-powerpoint">
<div id="ppt-viewer"></div>
import { createPptViewer } from '@file-viewer/ppt';

const viewer = await createPptViewer();
const input = document.querySelector('#ppt-file');

input.addEventListener('change', async () => {
  const file = input.files?.[0];
  if (!file) return;

  await viewer.mount('#ppt-viewer', await file.arrayBuffer(), {
    scale: 1,
    pixelRatio: window.devicePixelRatio
  });
});

mount() creates one Canvas per slide and renders progressively. No license file or origin registration is required for the public watermarked edition.

Render one slide

const response = await fetch('/documents/presentation.ppt');
const pptDocument = viewer.open(await response.arrayBuffer());

const canvas = document.querySelector('canvas');
pptDocument.renderSlide(0, canvas, { scale: 1.25 });

console.log(pptDocument.slideCount, pptDocument.width, pptDocument.height);
pptDocument.close();

Close documents when they are no longer needed so their native memory can be released immediately.

Core API

APIPurpose
createPptViewer() / loadPptViewer()Loads and verifies the native viewer engine
viewer.mount(target, input, options)Renders the complete presentation into Canvas elements
viewer.open(input)Opens a .ppt document and returns an opaque document handle
document.renderSlide(index, canvas, options)Renders one final RGBA slide frame to Canvas
document.close()Releases native document memory
getPptPackageManifest()Returns package and edition metadata

All public APIs include TypeScript declarations. Parsed document models, records, HTML, SVG, drawing command streams, and unwatermarked frames are not part of the public API.

Browser and deployment requirements

  • A current browser with ES modules, WebAssembly, Web Crypto, fetch, and Canvas 2D
  • Static hosting or a bundler that emits ppt-native.wasm beside index.mjs
  • application/wasm MIME type for .wasm assets
  • CSP permission to load the package's own module and WASM asset, including 'wasm-unsafe-eval' where required by the browser
  • Normal HTTP or HTTPS hosting; the public edition does not restrict origin

Compatibility notes

Traditional PowerPoint files may contain macros, ActiveX controls, OLE objects, linked media, or host-specific behaviors that browsers cannot execute. These features are treated as non-executable preview content. Font substitution may be used when an original document font is not available in the viewer's embedded fallback set.

Editions and licensing

EditionPermitted useWatermarkOrigin
Public npm editionIndividual personal, non-commercial, non-organizational useMandatory Flyfish Viewer on every slideAny normal HTTP/HTTPS origin
Commercial editionLicensed company, organization, customer project, intranet, SaaS, OEM, or production useWatermark-free build available according to the purchased agreementAccording to the commercial agreement

Commercial use requires a purchased license. Use by or for a company, organization, government body, school, nonprofit, team, employer, customer, or client—including internal evaluation—is commercial use.

The public npm edition is proprietary software and is not licensed under Apache-2.0. Removing, hiding, covering, replacing, or bypassing the required watermark is prohibited. See LICENSE for the binding terms.

Purchase a commercial license from the Flyfish Shop.

简体中文

专业传统 PPT 浏览器预览引擎

@file-viewer/ppt 是 Flyfish 纯自研的 PowerPoint 97–2003 二进制 .ppt 专业预览引擎。它直接理解传统 PPT 文件结构,并在现代浏览器中重建幻灯片,无需 安装 Microsoft Office、LibreOffice、浏览器插件,也不依赖服务端格式转换。

产品适用于文件预览平台、档案与知识管理系统、企业内网、SaaS 产品,以及仍需 稳定支持传统 PowerPoint 文档的 Web 应用。

产品特点

  • 原生理解 .ppt:直接读取复合文件、持久化记录、文字、绘图和图片结构。
  • 专业幻灯片还原:支持页面尺寸、母版、背景、配色、文字格式、可调节 OfficeArt 形状、填充、渐变、受限的传统 3D 挤出、组合对象、图片、旋转变换 和图层顺序。
  • 原生 WASM Canvas 链路:解析、布局、光栅化和公网水印合成全部在同一个 WebAssembly 引擎内完成;JavaScript 只将最终 RGBA 画面提交给 Canvas。
  • 文档本地处理:公网运行时不要求将文档上传到第三方转换服务。
  • 引擎完整性校验:执行前自动校验原生 WASM 的精确 SHA-256。
  • 易于集成:提供 ESM、TypeScript 类型,无 JavaScript 运行时依赖;既可 挂载完整预览器,也可单独渲染指定页。

格式范围

本包专门预览 PowerPoint 97–2003 二进制 .ppt 文件。XML 格式的 .pptx 应使用专用 PPTX 预览器。

安装

npm install @file-viewer/ppt

快速开始

<input id="ppt-file" type="file" accept=".ppt,application/vnd.ms-powerpoint">
<div id="ppt-viewer"></div>
import { createPptViewer } from '@file-viewer/ppt';

const viewer = await createPptViewer();
const input = document.querySelector('#ppt-file');

input.addEventListener('change', async () => {
  const file = input.files?.[0];
  if (!file) return;

  await viewer.mount('#ppt-viewer', await file.arrayBuffer(), {
    scale: 1,
    pixelRatio: window.devicePixelRatio
  });
});

mount() 会为每一页创建 Canvas 并渐进渲染。公网水印版不需要 license 文件, 也不限制正常 HTTP/HTTPS origin。

单页渲染

const response = await fetch('/documents/presentation.ppt');
const pptDocument = viewer.open(await response.arrayBuffer());

const canvas = document.querySelector('canvas');
pptDocument.renderSlide(0, canvas, { scale: 1.25 });

console.log(pptDocument.slideCount, pptDocument.width, pptDocument.height);
pptDocument.close();

文档不再使用时请调用 close(),以便立即释放原生内存。

核心 API

API用途
createPptViewer() / loadPptViewer()加载并校验原生预览引擎
viewer.mount(target, input, options)将完整演示文稿渲染为 Canvas 列表
viewer.open(input)打开 .ppt 并返回不透明文档句柄
document.renderSlide(index, canvas, options)将单页最终 RGBA 画面渲染到 Canvas
document.close()释放原生文档内存
getPptPackageManifest()返回包与版本信息

所有公开 API 均提供 TypeScript 类型。解析后的文档模型、记录、HTML、SVG、 绘图指令流和无水印画面均不属于公开 API。

浏览器与部署要求

  • 支持 ES Modules、WebAssembly、Web Crypto、fetch 和 Canvas 2D 的现代浏览器
  • 能将 ppt-native.wasmindex.mjs 一同发布的静态服务器或打包工具
  • .wasm 配置 application/wasm MIME 类型
  • CSP 允许加载包自身的模块和 WASM 资源;浏览器要求时需允许 'wasm-unsafe-eval'
  • 使用正常 HTTP 或 HTTPS 部署;公网版不限制 origin

兼容性说明

传统 PPT 可能包含宏、ActiveX、OLE、链接媒体或依赖桌面宿主的行为,浏览器无法 执行这些能力;预览器会把它们作为不可执行内容安全处理。原始字体不在内置回退 字体集时,会使用确定性的字体替代。

版本与授权

版本允许用途水印Origin
公网 npm 版自然人个人、非商业、非组织用途每页强制显示 Flyfish Viewer任意正常 HTTP/HTTPS origin
商业版已授权的公司、组织、客户项目、内网、SaaS、OEM 或生产用途按商业协议提供无公网水印构建按商业协议执行

任何商业用途均需购买授权。 公司、组织、政府、学校、非营利机构、团队、 雇主、客户或委托项目的使用,包括内部评估,均属于商业用途。

公网 npm 版是专有软件,不适用 Apache-2.0。禁止删除、隐藏、遮挡、替换或 绕过强制水印。具有法律约束力的完整条款见 LICENSE

商业授权请前往 Flyfish 商店购买。

产品链接

Keywords

ppt

FAQs

Package last updated on 17 Jul 2026

Did you know?

Socket

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.

Install

Related posts