# Filigrane

- Human documentation: [https://docs.univer.ai/fr-FR/guides/sheets/features/watermark](https://docs.univer.ai/fr-FR/guides/sheets/features/watermark)

- Agent Markdown: [https://docs.univer.ai/fr-FR/guides/sheets/features/watermark.md](https://docs.univer.ai/fr-FR/guides/sheets/features/watermark.md)

- Requested language: `fr-FR`

- Content language: `fr-FR`

- Documentation version: `1.2.0`

- Source: [sheets/features/watermark.fr-FR.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/sheets/features/watermark.fr-FR.mdx)

---

#### Package metadata

```json
{
  "plugins": [
    {
      "client": "@univerjs/watermark",
      "facade": "@univerjs/watermark/facade"
    }
  ],
  "server": false
}
```

La fonctionnalité de filigrane offre une solution flexible et sécurisée pour les feuilles de calcul. Elle permet aux développeurs d’ajouter des filigranes textuels ou graphiques et propose différentes options pour personnaliser leur apparence et leur comportement.

> [!INFO]
> Utilisez le [Générateur de filigranes](/tools/watermark-generator) pour prévisualiser les styles de filigrane et télécharger la configuration du plugin au format JSON.

> Interactive example: [Open the playground](/playground/sheets/watermark)

## Mode plugin

### Installation

#### npm

```bash
npm install @univerjs/watermark
```

#### pnpm

```bash
pnpm add @univerjs/watermark
```

#### yarn

```bash
yarn add @univerjs/watermark
```

#### bun

```bash
bun add @univerjs/watermark
```

### Utilisation

```typescript
import { UniverWatermarkPlugin } from '@univerjs/watermark' // [!code ++]

import '@univerjs/watermark/facade' // [!code ++]

const univer = new Univer({
  // ...
})

univer.registerPlugin(UniverWatermarkPlugin, { // [!code ++]
  textWatermarkSettings: { // [!code ++]
    content: 'Hello, Univer!', // [!code ++]
    fontSize: 36, // [!code ++]
  }, // [!code ++]
}) // [!code ++]
```

### Plugins et configuration

#### @univerjs/watermark

Ce plugin fournit l’implémentation principale de la fonctionnalité de filigrane. Il permet aux développeurs d’ajouter des filigranes textuels ou graphiques aux applications et propose différentes options pour personnaliser leur apparence et leur comportement. Il fournit le plugin `UniverWatermarkPlugin`.

Référence : [@univerjs/watermark](https://docs.univer.ai/fr-FR/reference/packages/plugins/univerjs/watermark.md)

## Mode prédéfini

La fonctionnalité de filigrane ne fournit pas de préréglage, mais son plugin peut être associé à des préréglages.

### Installation

#### npm

```bash
npm install @univerjs/watermark
```

#### pnpm

```bash
pnpm add @univerjs/watermark
```

#### yarn

```bash
yarn add @univerjs/watermark
```

#### bun

```bash
bun add @univerjs/watermark
```

### Utilisation

```typescript
import { UniverWatermarkPlugin } from '@univerjs/watermark' // [!code ++]

import '@univerjs/watermark/facade' // [!code ++]

const { univerAPI } = createUniver({
  // ...
  presets: [
    UniverSheetsCorePreset(),
  ],
  plugins: [
    [UniverWatermarkPlugin, { // [!code ++]
      textWatermarkSettings: { // [!code ++]
        content: 'Hello, Univer!', // [!code ++]
        fontSize: 36, // [!code ++]
      }, // [!code ++]
    }], // [!code ++]
  ],
})
```

## API Facade

### Importation

> [!INFO: Remarque sur le mode plugin]
> Seul le mode plugin nécessite d’importer manuellement le package Facade. Le mode prédéfini inclut déjà le package Facade correspondant : aucun import supplémentaire n’est nécessaire.

```typescript
import '@univerjs/watermark/facade'
```

### Ajouter un filigrane

```typescript
univerAPI.addWatermark('text', { content: 'hello', repeat: true })
```

### Supprimer un filigrane

```typescript
univerAPI.deleteWatermark()
```
