bilwy/watermark

为 dcat-admin 生成文本水印

v1.0.0 2023-12-03 14:40 UTC

This package is auto-updated.

Last update: 2024-09-03 16:55:37 UTC


README

在 dcat-admin 网页中添加生成文本水印功能。

安装

composer require bilwy/watermark

配置

在您的 config/admin.php 配置文件中添加 extensions 选项

'extensions' => [
    'watermark' => [
        'enable' => true,
        'config' => [
            'content' => 'username', // Admin::user()->username, or Admin::user()->name or fixed value like 'internal info'
            'width' => '100px',
            'height' => '120px',
            'textAlign' => 'left',
            'textBaseline' => 'alphabetic',
            'font' => '15px Times New Roman',
            'fillStyle' => 'rgba(204,204,204,0.4)',
            'rotate' => 30,
            'zIndex' => 1000,
        ]
    ]
]