安装
# or pnpm or yarn
npm install watermark-js-plus
用法
普通水印
import { Watermark } from 'watermark-js-plus'
const watermark = new Watermark({
content: 'hello my watermark',
width: 150,
height: 150,
fontSize: "26px",
fontColor: "#fff",
onSuccess: () => {
}
})
watermark.create()
暗水印
import { BlindWatermark } from 'watermark-js-plus'
const watermark = new BlindWatermark({
content: 'hello my watermark',
width: 150,
height: 150,
fontSize: "26px",
fontColor: "#fff",
onSuccess: () => {
}
})
watermark.create()
解析暗水印
import { BlindWatermark } from 'watermark-js-plus'
BlindWatermark.decode({
url: uploadFile.url,
onSuccess: (imageBase64) => {
}
})
官方文档
zhensherlock.github.io/watermark-j…