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

# Metadata

> Read and write PDF metadata and bookmarks with PDFEngines.

## Read metadata

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

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

Returns a buffer containing the metadata (format depends on Gotenberg). Typically used for inspection or debugging.

## Write metadata

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

const buffer = await PDFEngines.writeMetadata({
  files: ["path/to/file_1.pdf", "path/to/file_2.pdf"],
  metadata: {
    Author: "Your Name",
    Title: "Document Title",
    Keywords: ["pdf", "chromiumly"],
  },
});
```

The `metadata` object uses standard PDF/XMP field names. For a full list of supported keys, see [ExifTool PDF/XMP tag names](https://exiftool.org/TagNames/XMP.html#pdf).

## Read bookmarks

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

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

Returns a JSON buffer containing bookmarks for each input file.

## Write bookmarks

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

const updated = await PDFEngines.writeBookmarks({
  files: ["path/to/file_1.pdf"],
  bookmarks: [
    {
      title: "Chapter 1",
      page: 1,
      children: [],
    },
  ],
});
```

`bookmarks` accepts either a list applied to all files or a filename-to-list map.
