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

# Embedding files in PDFs

> Attach files to generated PDFs for ZUGFeRD, Factur-X, or other use cases.

Chromium converters and LibreOffice accept an `embeds` array to attach files to the generated PDF. Each item can be a file path string, a `Buffer`, or a `ReadStream`.

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

const htmlConverter = new HtmlConverter();
const buffer = await htmlConverter.convert({
  html: "path/to/index.html",
  embeds: [
    "path/to/invoice.xml",
    "path/to/logo.png",
    Buffer.from("additional data"),
  ],
});
```

Embedded files are attached to the PDF and can be extracted in readers that support attachments. This is used for [ZUGFeRD / Factur-X](https://fnfe-mpe.org/factur-x/) and similar standards that require embedding XML or other files inside the PDF.
