> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> [!NOTE]
>
> The PowerPoint packages are in private preview with alpha customers. [Contact us](https://reducto.ai/contact?source=docs_office_pptx) to get access.

## Install

```sh theme={null}
npm install @reductoai/pptx
```

For the editor UI, also install the editor package:

```sh theme={null}
npm install @reductoai/pptx-editor
```

## Optional native modules (Node)

PDF export needs none of these. They are optional; without one, the feature it serves is not available or uses a slower path.

| Module | Used for |
| - | - |
| `sharp` | Image decode and crops (a dependency) |
| `@resvg/resvg-js` | SVG, EMF and WMF pictures (optional peer) |
| `skia-canvas` | PNG export (optional peer) |

## Bundlers

* The package has a `browser` export condition. Vite, webpack and esbuild select the browser build when they bundle for a page, so webpack and Next.js bundle it without `fs` errors.
* Keep `@reductoai/pptx/node` out of client code. Mark `@resvg/resvg-js`, `sharp` and `skia-canvas` as external in a browser bundle.

## Smoke test

```ts theme={null}
import { PowerPointPresentation } from "@reductoai/pptx/node";

const deck = await PowerPointPresentation.create();
const slide = deck.slides.add();
slide.shapes.addTextBox("Hello, world", { left: 40, top: 40, width: 400, height: 60 });
await deck.save("hello.pptx");
await deck.toPdf("hello.pdf");
```

Run it with `npx tsx smoke.ts` (or compile it first). Open `hello.pdf`.
