1.1.0 • Published 9 months ago

@acrodata/watermark v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Watermark

npm license

Add watermark to your page.

Quick links

Documentation | Playground

Installation

npm install @acrodata/watermark --save

Usage

import { Component } from '@angular/core';
import { WatermarkDirective, WatermarkOptions } from '@acrodata/watermark';

@Component({
  selector: 'your-app',
  template: `
    <div watermark [watermarkOptions]="options">
      <p>...</p>
    </div>
  `,
  standalone: true,
  imports: [WatermarkDirective],
})
export class YourAppComponent {
  options: WatermarkOptions = {
    text: '...',
  };
}

API

Inputs

NameTypeDefaultDescription
optionsWatermarkOptions{}See WatermarkOptions
containerHTMLElement | string | nullundefinedSee WatermarkOptions['container']
securebooleantrueSee WatermarkOptions[secure]
zIndexnumber9999See WatermarkOptions[zIndex]
scrollHeightstring |numberundefinedSee WatermarkOptions[scrollHeight]

WatermarkOptions

NameTypeDefaultDescription
containerHTMLElement | string | nullundefinedContainer of the watermark
securebooleantrueWhether prevent the watermark being removed
imagestringundefinedImage source of the watermark, it's recommended to use 2x or 3x image
textstring | string[]undefinedText of the watermark and dispaly multiple lines with using array
blindTextstringundefinedText of the blind-watermark
blindFontSizestring | number16Font size of the blind-watermark
blindOpacityboolean0.005Opacity of the blind-watermark
repeat'none' | 'normal' | 'multiply'multiplySpecify how watermarks are repeated
positionstringundefinedSpecify background-position of the watermark
zIndexnumber9999Specify z-index of the watermark
scrollHeightnumber | stringundefinedSpecify the height of watermark in a scroll container
gapXnumber100Horizontal gap of watermark contents
gapYnumber100Vertical gap of watermark contents
offsetXnumber0Horizontal offset of the watermark content
offsetYnumber0Vertical offset of the watermark content
widthnumber120Width of the watermark content
heightnumber60Height of the watermark content
opacitynumber0.15Opacity of the watermark
rotatenumber-24Rotation degree of the watermark content
fontSizenumber16Font size of the text-watermark
fontWeightstring | number400Font weight of the text-watermark
fontStyle'normal' | 'italic'normalFont style of the text-watermark
fontVariant'normal' | 'small-capsnormalFont variant of the text-watermark
fontColorstring#000Font color of the text-watermark
fontFamilystringsans-serifFont family of the text-watermark
textAlignCanvasTextAligncenterText alignment of the text-watermark
textBaselineCanvasTextBaselinealphabeticText alignment of the text-watermark

License

MIT

1.1.0

9 months ago

1.0.0

9 months ago