> ## 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.

# .pptx to PDF

The PDF comes from the same layout that the editor and the PNG export use. Each slide is one page at the deck's slide size. Text stays text: it is selectable and searchable, and the fonts are embedded as subsets.

## Node: one call

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

const deck = await PowerPointPresentation.open("input.pptx");
await deck.toPdf("output.pdf");
```

`toPdf(path?)` returns the bytes too, so you can stream them instead of writing a file:

```ts theme={null}
const pdf = await deck.toPdf(); // Uint8Array
return new Response(new Uint8Array(pdf), { headers: { "content-type": "application/pdf" } });
```

## Node: low-level pipeline

Without the facade, lay out the file and paint the IR. Use one registry for layout and render: the PDF embeds the faces that the layout measured.

```ts theme={null}
import { writeFile } from "node:fs/promises";
import { defaultFontRegistry } from "@reductoai/pptx";
import { registerPptxFonts, runPptxPipelineFile } from "@reductoai/pptx/node";
import { renderPdfBytes } from "@reductoai/pptx/pdf";

registerPptxFonts();
const ir = await runPptxPipelineFile("deck.pptx");
const { bytes } = await renderPdfBytes(ir, defaultFontRegistry);
await writeFile("deck.pdf", bytes);
```

## Browser

Lay out the bytes with a face provider, then paint. See [JS API in the browser](https://docs.reducto.ai/office/pptx/js-api/browser.md#lay-out-and-render) for the steps.

## Options

`toPdf(path, options)` takes `ToPdfOptions`:

| Option | Notes |
| - | - |
| `includeHiddenSlides` | Paint hidden slides too. Default `false` |
| `paintPages` | Pages to paint. Other pages stay in the file at their true size, but blank |
| `onProgress` | Phase and per-page progress events |
| `signal` | An `AbortSignal` that stops the render between pages |

`runPptxPipeline` and `runPptxPipelineFile` take `includeHiddenSlides` and `onProgress`.

> [!NOTE]
>
> Results depend on fonts. With the portable profile, line breaks match Microsoft PowerPoint's when the deck uses Office fonts that have a metric clone (Calibri, Cambria, Arial, Times New Roman, Courier New). See [Fonts](https://docs.reducto.ai/office/pptx/getting-started/fonts.md).
