@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
97 lines • 3.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatermarkFont = void 0;
class WatermarkFont {
constructor(data) {
let boldDefault = false;
this.bold = typeof (data === null || data === void 0 ? void 0 : data.bold) !== "undefined" ? data === null || data === void 0 ? void 0 : data.bold : boldDefault;
let colorDefault = "#A0A0A0";
this.color = typeof (data === null || data === void 0 ? void 0 : data.color) !== "undefined" ? data === null || data === void 0 ? void 0 : data.color : colorDefault;
let italicDefault = false;
this.italic = typeof (data === null || data === void 0 ? void 0 : data.italic) !== "undefined" ? data === null || data === void 0 ? void 0 : data.italic : italicDefault;
let nameDefault = "";
this.name = typeof (data === null || data === void 0 ? void 0 : data.name) !== "undefined" ? data === null || data === void 0 ? void 0 : data.name : nameDefault;
let opacityDefault = 100;
this.opacity = typeof (data === null || data === void 0 ? void 0 : data.opacity) !== "undefined" ? data === null || data === void 0 ? void 0 : data.opacity : opacityDefault;
let outlineDefault = false;
this.outline = typeof (data === null || data === void 0 ? void 0 : data.outline) !== "undefined" ? data === null || data === void 0 ? void 0 : data.outline : outlineDefault;
let sizeDefault = 24;
this.size = typeof (data === null || data === void 0 ? void 0 : data.size) !== "undefined" ? data === null || data === void 0 ? void 0 : data.size : sizeDefault;
}
static getBoldDefault() {
return false;
}
static getBoldDescription() {
return "Used to increase the text output's weight.";
}
static getColorDefault() {
return "#A0A0A0";
}
static getColorDescription() {
return "Used to set the colour for the watermark. The hereby defined color needs to be specified as a hexadecimal RGB value with a number sign before it.";
}
static getItalicDefault() {
return false;
}
static getItalicDescription() {
return "Used to set the italic font posture for the text output.";
}
static getNameDefault() {
return "";
}
static getNameDescription() {
return "Used to specify the name of the font that should be used for the text output. If a font is not specified, \"Helvetica\" will be used.";
}
static getOpacityDefault() {
return 100;
}
static getOpacityDescription() {
return "Used to set the opacity of the text output as a watermark.";
}
static getOpacityMin() {
return 0;
}
static getOpacityMax() {
return 100;
}
static getOutlineDefault() {
return false;
}
static getOutlineDescription() {
return "Uses an outline font for the text output.";
}
static getSizeDefault() {
return 24;
}
static getSizeDescription() {
return "Used to set the text size for the text output.";
}
static getSizeMin() {
return 1;
}
static getSizeMax() {
return 1296;
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new WatermarkFont(data);
}
toJson() {
return {
'bold': this.bold,
'color': this.color,
'italic': this.italic,
'name': this.name,
'opacity': this.opacity,
'outline': this.outline,
'size': this.size,
};
}
clone() {
return WatermarkFont.fromJson(this.toJson());
}
}
exports.WatermarkFont = WatermarkFont;
//# sourceMappingURL=WatermarkFont.js.map