@namahapdf/pptx
v0.2.1
Published
Headless in-browser PowerPoint engine — parse, render, edit (.pptx write-back), export to PDF, and project to an AI-readable model. Part of the NamahaPDF SDK.
Readme
@namahapdf/pptx - In-Browser PowerPoint (.pptx) Engine for JavaScript
@namahapdf/pptx is a headless PowerPoint engine that runs entirely in the
browser - parse a .pptx, render slides to canvas, edit with faithful write-back,
export to PDF, and project a deck into an AI-readable model. It's an in-house OOXML
implementation (no LibreOffice, no cloud conversion service), built for the rare
capability most PDF/Office SDKs skip: editing a PowerPoint deck client-side and
saving a byte-faithful .pptx back, with no repair dialog on open.
Live demo · Full docs · Get a license
npm i @namahapdf/pptximport {
PptxEditSession,
renderSlide,
applyPptxPlan,
configureLicense,
} from '@namahapdf/pptx';
// Apply your license key (without one, exports are watermarked + features limited).
configureLicense({ licenseKey: 'YOUR_KEY' });
// Load a deck into an editing session, edit by intents, save a faithful .pptx.
const session = await PptxEditSession.load('deck.pptx', bytes);
await session.apply([
{ op: 'replace-text', anchor: { fmt: 'pptx', slidePart: 'ppt/slides/slide1.xml', shapeId: '2' }, newText: 'Q3 Review' },
]);
const editedBytes = session.bytes; // still a valid .pptxFeatures
- Parser -
.pptx→ a resolved slide model (theme/master/layout composed), fully client-side - Renderer - high-DPI slide raster + positioned, selectable text segments
- Faithful write-back - edits apply as surgical XML splices on the original package, so everything an edit doesn't touch is preserved byte-for-byte
- PDF export - hybrid raster + real selectable text, no LibreOffice
- AI-ready - a small, JSON-serializable
EditPlanvocabulary (replace-text,move-shape,add-slide,replace-image, …); validate withvalidateEditPlanand the same plan an LLM emits is the plan the UI emits - TypeScript-first, ESM + CJS builds
Why teams pick @namahapdf/pptx
Client-side PowerPoint editing is rare. Most document SDKs that support Office
formats lean on server components or offer view-only rendering. @namahapdf/pptx
edits and re-saves a real .pptx entirely in the browser.
Round-trip fidelity by construction. The parsed slide model is a render view, not
the source of truth - the writer always re-opens the original zip/XML and splices
only what an EditPlan intent changed, so untouched slides, masters, and layouts are
byte-identical to the source file.
On-device by architecture. Parsing, rendering, and editing all run client-side - no upload step, no cloud dependency for the common path.
One intent vocabulary for humans and AI. The UI and an LLM agent emit the exact
same EditPlan JSON against the exact same apply path - there's no separate,
riskier "AI editing" code path to maintain or trust.
API surface
PptxParser-.pptx→ a resolved slide modelrenderSlide- a slide → a high-DPI background raster + positioned text segmentsapplyPptxPlan/PptxEditSession- write-back (intent-sourced, undo/redo)toStructure- a semantic projection for Markdown / RAG / AIpptxToPdf- export a deck to PDF
The full API reference and edit-intent contract live in the PowerPoint SDK docs.
Licensing
Free to install and use - trial mode renders a watermark and gates premium features.
A per-domain license key removes the watermark and unlocks the full feature set. Get
one at pdf.namahatech.com/sdk; pricing at
pdf.namahatech.com/pricing. A ready-made
React slide editor (@namahapdf/react) is planned.
Related packages
| Package | What it is |
|---|---|
| @namahapdf/pptx | This package - the headless PowerPoint engine |
| @namahapdf/core | Headless PDF engine |
| @namahapdf/sheets | Headless Excel (.xlsx) engine |
| @namahapdf/react | React <NamahaEditor> (PDF today) |
FAQ
Does this upload .pptx files to a server?
No. Parsing, rendering, and editing all run in the browser. Nothing is uploaded for
the common path.
Will edited decks open in PowerPoint without a repair-dialog warning?
Yes - that's the core design constraint. Write-back is byte-preserving on anything
an EditPlan doesn't explicitly touch; npm run audit:pptx in the source repo is
the fidelity regression gate.
Can an LLM agent edit a deck with this?
Yes - EditPlan is a small, Zod-validated JSON schema
(validateEditPlan/editPlanJsonSchema) designed to be handed to an LLM as a tool
definition; the agent emits the same intents the UI does.
Is there a free tier? Yes. It's free to install and use in trial mode (watermarked, feature-limited). See pdf.namahatech.com/pricing for licensed tiers.
License: proprietary (see LICENSE). A license key from
pdf.namahatech.com/sdk removes the trial watermark
for production use. Questions or enterprise inquiries: same link.
