@namahapdf/pptx
v0.1.0
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.
Downloads
59
Maintainers
Readme
@namahapdf/pptx
Headless, in-browser PowerPoint engine — parse, render, edit .pptx (with faithful
write-back), export to PDF, and project to an AI-readable model. Fully on-device,
framework-agnostic. Part of the NamahaPDF SDK.
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 .pptxEdits flow through a small, JSON-serializable EditPlan vocabulary
(replace-text, move-shape, add-slide, replace-image, …) applied as surgical XML
splices on the original package, so everything the plan doesn't touch is preserved
byte-for-byte. The same plan an LLM emits (validate it with validateEditPlan) is the
plan the UI emits — AI parity is free.
PptxParser—.pptx→ a resolved slide model (theme/master/layout composed).renderSlide— a slide → a high-DPI background raster + positioned text segments.applyPptxPlan/PptxEditSession— write-back (intent-sourced, undo/redo).toStructure— a semantic projection for Markdown / RAG / AI.pptxToPdf— export a deck to PDF (hybrid raster + real selectable text).
Get a license key at namahapdf.com/sdk. Free to download but watermarked and feature-limited until a valid key is applied. A ready-made React slide editor in @namahapdf/react is planned.
