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

# Flatten PDFs

> Flatten forms and annotations into static content with PDFEngines.flatten.

Flattening turns interactive elements (form fields, annotations) into static content so the document looks the same everywhere and cannot be edited.

```typescript theme={null}
import { PDFEngines } from "chromiumly";

const buffer = await PDFEngines.flatten([
  "path/to/file_1.pdf",
  "path/to/file_2.pdf",
]);
```

Returns a single PDF buffer. `downloadFrom`, `webhook`, `outputFilename`, and `trace` are also accepted — see [Request tracing](https://docs.chromiumly.dev/v6/advanced/request-tracing.md).

Chromium converters and `LibreOffice.convert()` also accept a top-level `flatten: true` option to flatten the resulting PDF's form fields and annotations in the same request. It's a separate field from `split` there — see the note in [Split PDFs](https://docs.chromiumly.dev/v6/pdf-engines/split.md). On the dedicated `PDFEngines.split()` route, `flatten` nests inside `options` instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.