UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

97 lines 5.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WatermarkPosition = void 0; class WatermarkPosition { constructor(data) { let aspectRatioDefault = true; this.aspectRatio = typeof (data === null || data === void 0 ? void 0 : data.aspectRatio) !== "undefined" ? data === null || data === void 0 ? void 0 : data.aspectRatio : aspectRatioDefault; let heightDefault = 0; this.height = typeof (data === null || data === void 0 ? void 0 : data.height) !== "undefined" ? data === null || data === void 0 ? void 0 : data.height : heightDefault; let metricsDefault = "mm"; this.metrics = typeof (data === null || data === void 0 ? void 0 : data.metrics) !== "undefined" ? data === null || data === void 0 ? void 0 : data.metrics : metricsDefault; let positionDefault = "center_center"; this.position = typeof (data === null || data === void 0 ? void 0 : data.position) !== "undefined" ? data === null || data === void 0 ? void 0 : data.position : positionDefault; let widthDefault = 0; this.width = typeof (data === null || data === void 0 ? void 0 : data.width) !== "undefined" ? data === null || data === void 0 ? void 0 : data.width : widthDefault; let xDefault = 0; this.x = typeof (data === null || data === void 0 ? void 0 : data.x) !== "undefined" ? data === null || data === void 0 ? void 0 : data.x : xDefault; let yDefault = 0; this.y = typeof (data === null || data === void 0 ? void 0 : data.y) !== "undefined" ? data === null || data === void 0 ? void 0 : data.y : yDefault; } static getAspectRatioDefault() { return true; } static getAspectRatioDescription() { return "Forces the aspect ratio to be maintained when a watermark is scaled if \"width\" and \"height\" are specified."; } static getHeightDefault() { return 0; } static getHeightDescription() { return "Forces the specified height for the watermark if the values are not equal 0. In this case, the watermark will be scaled inside the area, which may result in the image losing quality or being distorted (please refer to \"aspectRatio\" as well)"; } static getHeightMin() { return 0; } static getMetricsDefault() { return "mm"; } static getMetricsDescription() { return "Unit for the X-axis\/Y-axis position and signature field height and width arguments:\n\n* pt = Points(1\/72 inch)\n* pc = Picas(12 points)\n* px = Pixels(1\/96 inch)\n* mm = Millimeters\n* in = Inches"; } static getPositionDefault() { return "center_center"; } static getPositionDescription() { return "Uses one of multiple preset positions in order to position the watermark on the page.\n\n* custom = Disable the use of a preset position.\n* top\\_left = Positions the watermark in the upper left corner.\n* top\\_center = Positions the watermark in the centre at the top margin.\n* top\\_right = Positions the watermark in the top right corner.\n* center\\_left = Positions the watermark at the centre of the page, to the left.\n* center\\_center = Positions the watermark at the centre of the page.\n* center\\_right = Positions the watermark at the centre of the page, to the right.\n* bottom\\_left = Positions the watermark in the bottom left corner.\n* bottom\\_center = Positions the watermark in the centre at the bottom margin.\n* bottom\\_right = Positions the watermark in the bottom right corner."; } static getWidthDefault() { return 0; } static getWidthDescription() { return "Forces the specified width for the watermark if the values are not equal 0. In this case, the watermark will be scaled inside the area, which may result in the image losing quality or being distorted (please refer to \"aspectRatio\" as well)"; } static getWidthMin() { return 0; } static getXDefault() { return 0; } static getXDescription() { return "Used to define the X-axis position (as per metrics), starting from the top left corner of the PDF document, if position is set to \"custom.\". If \"position is set to a different value, these arguments will be interpreted as \"offsets\" from the selected position. This specification applies for both the text and image output."; } static getXMin() { return 0; } static getYDefault() { return 0; } static getYDescription() { return "Used to define the Y-axis position (as per metrics), starting from the top left corner of the PDF document, if position is set to \"custom.\". If \"position is set to a different value, these arguments will be interpreted as \"offsets\" from the selected position. This specification applies for both the text and image output."; } static getYMin() { return 0; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new WatermarkPosition(data); } toJson() { return { 'aspectRatio': this.aspectRatio, 'height': this.height, 'metrics': this.metrics, 'position': this.position, 'width': this.width, 'x': this.x, 'y': this.y, }; } clone() { return WatermarkPosition.fromJson(this.toJson()); } } exports.WatermarkPosition = WatermarkPosition; //# sourceMappingURL=WatermarkPosition.js.map