Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/watermark

Index

Type aliases

TextWmOptions

TextWmOptions: Partial<{ content: string; font: { color: string; family?: string; lineHeight: string; size: string; style: string; weight: string }; textAlign: CanvasTextDrawingStyles["textAlign"]; textBaseline: CanvasTextDrawingStyles["textBaseline"] }>

水印文字设置

WmBaseOptions

WmBaseOptions: { content: string; opacity: string | number; rotate: string }

水印配置

Type declaration

  • content: string

    内容,图片链接或者文字

  • opacity: string | number

    透明度

  • rotate: string

    旋转角度

WmImgOptions

WmImgOptions: { img: { placement: "tl" | "tr" | "center" | "bl" | "br"; width: string }; type: "img" } & WmBaseOptions

图片水印

WmTextOptions

WmTextOptions: { font: TextWmOptions["font"]; multi: boolean; type: "text" } & WmBaseOptions

文字水印

Functions

getTextWidth

  • getTextWidth(content: string, font: { color: string; family?: string; lineHeight: string; size: string; style: string; weight: string }): number
  • Parameters

    • content: string
    • font: { color: string; family?: string; lineHeight: string; size: string; style: string; weight: string }
      • color: string
      • Optional family?: string
      • lineHeight: string
      • size: string
      • style: string
      • weight: string

    Returns number

getTextWm

  • getTextWm(__namedParameters?: Partial<{ content: string; font: { color: string; family?: string; lineHeight: string; size: string; style: string; weight: string }; textAlign: CanvasTextAlign; textBaseline: CanvasTextBaseline }>): string
  • 用于生成水印

    description

    用于pdf和video水印

    Parameters

    • __namedParameters: Partial<{ content: string; font: { color: string; family?: string; lineHeight: string; size: string; style: string; weight: string }; textAlign: CanvasTextAlign; textBaseline: CanvasTextBaseline }> = {}

    Returns string

Generated using TypeDoc