UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

118 lines 5.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PieceInfoBackgroundContent = void 0; class PieceInfoBackgroundContent { constructor(data) { let absoluteScalingDefault = true; this.absoluteScaling = typeof (data === null || data === void 0 ? void 0 : data.absoluteScaling) !== "undefined" ? data === null || data === void 0 ? void 0 : data.absoluteScaling : absoluteScalingDefault; let alignmentDefault = "top_left"; this.alignment = typeof (data === null || data === void 0 ? void 0 : data.alignment) !== "undefined" ? data === null || data === void 0 ? void 0 : data.alignment : alignmentDefault; let colorDefault = "#FFFFFF"; this.color = typeof (data === null || data === void 0 ? void 0 : data.color) !== "undefined" ? data === null || data === void 0 ? void 0 : data.color : colorDefault; let horizOffsetDefault = 0.0; this.horizOffset = typeof (data === null || data === void 0 ? void 0 : data.horizOffset) !== "undefined" ? data === null || data === void 0 ? void 0 : data.horizOffset : horizOffsetDefault; let opacityDefault = 1.0; this.opacity = typeof (data === null || data === void 0 ? void 0 : data.opacity) !== "undefined" ? data === null || data === void 0 ? void 0 : data.opacity : opacityDefault; 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 = 1; this.scale = typeof (data === null || data === void 0 ? void 0 : data.scale) !== "undefined" ? data === null || data === void 0 ? void 0 : data.scale : scaleDefault; let unitDefault = ""; this.unit = typeof (data === null || data === void 0 ? void 0 : data.unit) !== "undefined" ? data === null || data === void 0 ? void 0 : data.unit : unitDefault; let vertOffsetDefault = 0.0; this.vertOffset = typeof (data === null || data === void 0 ? void 0 : data.vertOffset) !== "undefined" ? data === null || data === void 0 ? void 0 : data.vertOffset : vertOffsetDefault; } static getAbsoluteScalingDefault() { return true; } static getAbsoluteScalingDescription() { return "When set to true the page shall be scaled relative to it's own original dimensions, when set to false, it shall be scaled relative to the page dimensions."; } static getAlignmentDefault() { return "top_left"; } static getAlignmentDescription() { return "Uses one of multiple preset positions in order to position the background on the page.\n\n* custom = Disable the use of a preset position.\n* top\\_left = Positions the background in the top left corner.\n* top\\_center = Positions the background in the centre on the top margin.\n* top\\_right = Positions the background in the top right corner.\n* center\\_left = Positions the background at the centre of the page, to the left.\n* center\\_center = Positions the background at the centre of the page.\n* center\\_right = Positions the background at the centre of the page, to the right.\n* bottom\\_left = Positions the background in the bottom left corner.\n* bottom\\_center = Positions the background in the centre on the bottom margin.\n* bottom\\_right = Positions the background in the bottom right corner."; } static getColorDefault() { return "#FFFFFF"; } static getColorDescription() { return "The color of a unicolor background."; } static getHorizOffsetDefault() { return 0.0; } static getHorizOffsetDescription() { return "The horizontal offset in relation to the backgrounds bas position."; } static getOpacityDefault() { return 1.0; } static getOpacityDescription() { return "The opacity of the background, as a percentage in the range 0.0 (fully transparent) to 1.0 (fully opaque)."; } static getOpacityMin() { return 0; } static getOpacityMax() { return 1; } static getRotationDefault() { return 0; } static getRotationDescription() { return "The rotation of the background."; } static getRotationMin() { return 0; } static getRotationMax() { return 360; } static getScaleDefault() { return 1; } static getScaleDescription() { return "The scaling of the background."; } static getScaleMin() { return 0; } static getUnitDefault() { return ""; } static getUnitDescription() { return "The Adobe unit used to display offsets in readers. (millimeters, pica, point etc)."; } static getVertOffsetDefault() { return 0.0; } static getVertOffsetDescription() { return "The vertical offset in relation to the backgrounds bas position."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new PieceInfoBackgroundContent(data); } toJson() { return { 'absoluteScaling': this.absoluteScaling, 'alignment': this.alignment, 'color': this.color, 'horizOffset': this.horizOffset, 'opacity': this.opacity, 'rotation': this.rotation, 'scale': this.scale, 'unit': this.unit, 'vertOffset': this.vertOffset, }; } clone() { return PieceInfoBackgroundContent.fromJson(this.toJson()); } } exports.PieceInfoBackgroundContent = PieceInfoBackgroundContent; //# sourceMappingURL=PieceInfoBackgroundContent.js.map