@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
99 lines • 4.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackgroundBaseSettings = void 0;
const index_1 = require("./../index");
class BackgroundBaseSettings {
constructor(data) {
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;
this.pages = index_1.PagesBackgroundBaseSettings.fromJson(data === null || data === void 0 ? void 0 : data.pages);
this.position = index_1.PositionBackgroundBaseSettings.fromJson(data === null || data === void 0 ? void 0 : data.position);
let relativeToPageDefault = true;
this.relativeToPage = typeof (data === null || data === void 0 ? void 0 : data.relativeToPage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.relativeToPage : relativeToPageDefault;
let replaceExistingDefault = false;
this.replaceExisting = typeof (data === null || data === void 0 ? void 0 : data.replaceExisting) !== "undefined" ? data === null || data === void 0 ? void 0 : data.replaceExisting : replaceExistingDefault;
let rotationDefault = 0;
this.rotation = typeof (data === null || data === void 0 ? void 0 : data.rotation) !== "undefined" ? data === null || data === void 0 ? void 0 : data.rotation : rotationDefault;
let scaleDefault = 100;
this.scale = typeof (data === null || data === void 0 ? void 0 : data.scale) !== "undefined" ? data === null || data === void 0 ? void 0 : data.scale : scaleDefault;
this.visibility = index_1.VisibilityBackgroundBaseSettings.fromJson(data === null || data === void 0 ? void 0 : data.visibility);
}
static getOpacityDefault() {
return 100;
}
static getOpacityDescription() {
return "A percentage value that is used to specify the background layer's transparency (100 percent means fully visible).";
}
static getOpacityMin() {
return 0;
}
static getOpacityMax() {
return 100;
}
static getPagesDescription() {
return "";
}
static getPositionDescription() {
return "";
}
static getRelativeToPageDefault() {
return true;
}
static getRelativeToPageDescription() {
return "If true, the background layer will not be scaled relative to its own original size, but rather to the dimensions of the page containing it.";
}
static getReplaceExistingDefault() {
return false;
}
static getReplaceExistingDescription() {
return "If true, an existing background layer will be automatically deleted and replaced with the new one. If false, an existing background layer will cause the operation to be aborted.";
}
static getRotationDefault() {
return 0;
}
static getRotationDescription() {
return "A value between 0 and 360 degrees that is used to specify the background layer's rotation.";
}
static getRotationMin() {
return 0;
}
static getRotationMax() {
return 360;
}
static getScaleDefault() {
return 100;
}
static getScaleDescription() {
return "A percentage value used to specify the scaling for the background layer. This scaling can either be relative to the background layer's original size or to the dimensions of the page containing it (depends on the \"relativeToPage\" parameter)";
}
static getScaleMin() {
return 0;
}
static getVisibilityDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new BackgroundBaseSettings(data);
}
toJson() {
var _a, _b, _c;
return {
'opacity': this.opacity,
'pages': (_a = this.pages) === null || _a === void 0 ? void 0 : _a.toJson(),
'position': (_b = this.position) === null || _b === void 0 ? void 0 : _b.toJson(),
'relativeToPage': this.relativeToPage,
'replaceExisting': this.replaceExisting,
'rotation': this.rotation,
'scale': this.scale,
'visibility': (_c = this.visibility) === null || _c === void 0 ? void 0 : _c.toJson(),
};
}
clone() {
return BackgroundBaseSettings.fromJson(this.toJson());
}
}
exports.BackgroundBaseSettings = BackgroundBaseSettings;
//# sourceMappingURL=BackgroundBaseSettings.js.map