@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
61 lines • 2.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatermarkImage = void 0;
const index_1 = require("./../index");
class WatermarkImage {
constructor(data) {
this.data = index_1.WatermarkFileData.fromJson(data.data);
let opacityDefault = 25;
this.opacity = typeof (data === null || data === void 0 ? void 0 : data.opacity) !== "undefined" ? data === null || data === void 0 ? void 0 : data.opacity : opacityDefault;
this.position = index_1.WatermarkPosition.fromJson(data === null || data === void 0 ? void 0 : data.position);
let scaleDefault = 0;
this.scale = typeof (data === null || data === void 0 ? void 0 : data.scale) !== "undefined" ? data === null || data === void 0 ? void 0 : data.scale : scaleDefault;
}
static getDataDescription() {
return "";
}
static getOpacityDefault() {
return 25;
}
static getOpacityDescription() {
return "Used to set the image's opacity. A percent value between 0 and 100 is allowed, whereby 0 equals the minimum opacity. The higher the value, the more the content of the PDF document will be covered over.";
}
static getOpacityMin() {
return 0;
}
static getOpacityMax() {
return 100;
}
static getPositionDescription() {
return "";
}
static getScaleDefault() {
return 0;
}
static getScaleDescription() {
return "Specifies the scaling of the image in percent.";
}
static getScaleMin() {
return 0;
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new WatermarkImage(data);
}
toJson() {
var _a, _b;
return {
'data': (_a = this.data) === null || _a === void 0 ? void 0 : _a.toJson(),
'opacity': this.opacity,
'position': (_b = this.position) === null || _b === void 0 ? void 0 : _b.toJson(),
'scale': this.scale,
};
}
clone() {
return WatermarkImage.fromJson(this.toJson());
}
}
exports.WatermarkImage = WatermarkImage;
//# sourceMappingURL=WatermarkImage.js.map