UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

88 lines 3.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SignaturePosition = void 0; class SignaturePosition { constructor(data) { let coordinatesDefault = "user"; this.coordinates = typeof (data === null || data === void 0 ? void 0 : data.coordinates) !== "undefined" ? data === null || data === void 0 ? void 0 : data.coordinates : coordinatesDefault; let heightDefault = 10; 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 widthDefault = 50; 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 getCoordinatesDefault() { return "user"; } static getCoordinatesDescription() { return "Used to define the coordinate system and, accordingly, the origin for the position arguments.\n\n* user = User coordinate system (origin at top left)\n* pdf = PDF coordinate system (origin at bottom left)"; } static getHeightDefault() { return 10; } static getHeightDescription() { return "The signature field's height"; } 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 getWidthDefault() { return 50; } static getWidthDescription() { return "The signature field's width"; } static getWidthMin() { return 0; } static getXDefault() { return 0; } static getXDescription() { return "X-axis position."; } static getXMin() { return 0; } static getYDefault() { return 0; } static getYDescription() { return "Y-axis position."; } static getYMin() { return 0; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new SignaturePosition(data); } toJson() { return { 'coordinates': this.coordinates, 'height': this.height, 'metrics': this.metrics, 'width': this.width, 'x': this.x, 'y': this.y, }; } clone() { return SignaturePosition.fromJson(this.toJson()); } } exports.SignaturePosition = SignaturePosition; //# sourceMappingURL=SignaturePosition.js.map