@namahapdf/pptx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -0
- package/README.md +44 -0
- package/dist/index.cjs +94 -0
- package/dist/index.d.cts +897 -0
- package/dist/index.d.ts +897 -0
- package/dist/index.js +94 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
NamahaPDF SDK License (Proprietary)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NamahaPDF. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software (the "SDK") is licensed, not sold. Use of the SDK in any application
|
|
6
|
+
requires a valid commercial license key issued by NamahaPDF. Without a valid key the
|
|
7
|
+
SDK operates in a restricted, watermarked evaluation mode and may not be used in
|
|
8
|
+
production.
|
|
9
|
+
|
|
10
|
+
You may NOT, except to the extent permitted by your commercial license agreement:
|
|
11
|
+
remove, disable, or circumvent the license enforcement or watermarking; redistribute,
|
|
12
|
+
sublicense, or resell the SDK; or use the SDK beyond the scope (domains, seats,
|
|
13
|
+
features, term) granted by your license.
|
|
14
|
+
|
|
15
|
+
THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. To obtain a license, see
|
|
16
|
+
https://namahapdf.com/sdk.
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @namahapdf/pptx
|
|
2
|
+
|
|
3
|
+
Headless, in-browser **PowerPoint engine** — parse, render, edit `.pptx` (with faithful
|
|
4
|
+
write-back), export to PDF, and project to an AI-readable model. Fully on-device,
|
|
5
|
+
framework-agnostic. Part of the **NamahaPDF SDK**.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @namahapdf/pptx
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
PptxEditSession,
|
|
14
|
+
renderSlide,
|
|
15
|
+
applyPptxPlan,
|
|
16
|
+
configureLicense,
|
|
17
|
+
} from '@namahapdf/pptx';
|
|
18
|
+
|
|
19
|
+
// Apply your license key (without one, exports are watermarked + features limited).
|
|
20
|
+
configureLicense({ licenseKey: 'YOUR_KEY' });
|
|
21
|
+
|
|
22
|
+
// Load a deck into an editing session, edit by intents, save a faithful .pptx.
|
|
23
|
+
const session = await PptxEditSession.load('deck.pptx', bytes);
|
|
24
|
+
await session.apply([
|
|
25
|
+
{ op: 'replace-text', anchor: { fmt: 'pptx', slidePart: 'ppt/slides/slide1.xml', shapeId: '2' }, newText: 'Q3 Review' },
|
|
26
|
+
]);
|
|
27
|
+
const editedBytes = session.bytes; // still a valid .pptx
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Edits flow through a small, JSON-serializable **`EditPlan`** vocabulary
|
|
31
|
+
(`replace-text`, `move-shape`, `add-slide`, `replace-image`, …) applied as surgical XML
|
|
32
|
+
splices on the original package, so everything the plan doesn't touch is preserved
|
|
33
|
+
byte-for-byte. The same plan an LLM emits (validate it with `validateEditPlan`) is the
|
|
34
|
+
plan the UI emits — AI parity is free.
|
|
35
|
+
|
|
36
|
+
- **`PptxParser`** — `.pptx` → a resolved slide model (theme/master/layout composed).
|
|
37
|
+
- **`renderSlide`** — a slide → a high-DPI background raster + positioned text segments.
|
|
38
|
+
- **`applyPptxPlan` / `PptxEditSession`** — write-back (intent-sourced, undo/redo).
|
|
39
|
+
- **`toStructure`** — a semantic projection for Markdown / RAG / AI.
|
|
40
|
+
- **`pptxToPdf`** — export a deck to PDF (hybrid raster + real selectable text).
|
|
41
|
+
|
|
42
|
+
Get a license key at **namahapdf.com/sdk**. Free to download but watermarked and
|
|
43
|
+
feature-limited until a valid key is applied. A ready-made React slide editor in
|
|
44
|
+
**@namahapdf/react** is planned.
|