TextMarkOptions
Defined in: index.ts:587
Options for text watermark
Example
Section titled “Example”backgroundImage: { src: require('./images/logo.png'), scale: 0.5, rotate: 45, alpha: 0.5 }, watermarkTexts: [ { text: 'hello world', position: { X: 10, Y: 10, // or // position: Position.center }, style: { color: '#aacc22', fontName: 'Arial', fontSize: 12, shadowStyle: { dx: 10, dy: 10, radius: 10, color: '#aacc22' }, textBackgroundStyle: { paddingX: 10, paddingY: 10, type: TextBackgroundType.stretchX, color: '#aacc22' }, underline: true, strikeThrough: true, textAlign: 'left', italic: true, //or // skewX: -0.25, bold: true, rotate: 45 } }], quality: 100, filename: 'test', saveFormat: ImageFormat.jpg,Properties
Section titled “Properties”backgroundImage
Section titled “backgroundImage”backgroundImage:
ImageOptions
Defined in: index.ts:598
background image options
Example
Section titled “Example”backgroundImage: { src: require('./images/logo.png'), scale: 0.5, rotate: 45, alpha: 0.5}filename?
Section titled “filename?”
optionalfilename?:string
Defined in: index.ts:652
save image name
Example
Section titled “Example”filename: 'test'matteColor?
Section titled “matteColor?”
optionalmatteColor?:string
Defined in: index.ts:668
Matte color used when an output with transparency is encoded as JPEG. JPEG has no alpha channel, so transparent pixels are composited over this color before encoding.
Default Value
Section titled “Default Value”#FFFFFF
Example
Section titled “Example”matteColor: '#FFFFFF'maxSize?
Section titled “maxSize?”
optionalmaxSize?:number
Defined in: index.ts:686
Default Value
Section titled “Default Value”2048Example
Section titled “Example”maxSize: 2048quality?
Section titled “quality?”
optionalquality?:number
Defined in: index.ts:646
Integer image quality from 0 to 100, where 100 is best. Quality has
the most visible effect when the output format is jpg. See #159.
Default Value
Section titled “Default Value”100Example
Section titled “Example”quality: 100rotationCanvasMode?
Section titled “rotationCanvasMode?”
optionalrotationCanvasMode?:RotationCanvasMode
Defined in: index.ts:676
Controls whether background rotation expands the output canvas or crops back to the original canvas dimensions.
Default Value
Section titled “Default Value”RotationCanvasMode.expandExample
Section titled “Example”rotationCanvasMode: RotationCanvasMode.cropsaveFormat?
Section titled “saveFormat?”
optionalsaveFormat?:ImageFormat
Defined in: index.ts:659
save image format
Default Value
Section titled “Default Value”jpg
Example
Section titled “Example”saveFormat: ImageFormat.pngwatermarkTexts
Section titled “watermarkTexts”watermarkTexts:
TextOptions[]
Defined in: index.ts:638
text options
Example
Section titled “Example”watermarkTexts: [{ text: 'hello world', position: { X: 10, Y: 10, // or // position: Position.center }, style: { color: '#aacc22', fontName: 'Arial', fontSize: 12, shadowStyle: { dx: 10, dy: 10, radius: 10, color: '#aacc22' }, textBackgroundStyle: { paddingX: 10, paddingY: 10, type: TextBackgroundType.stretchX, color: '#aacc22' }, underline: true, strikeThrough: true, textAlign: 'left', italic: true, //or // skewX: -0.25, bold: true, rotate: 45 }}]