UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

64 lines 2.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Point = void 0; class Point { 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 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 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 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 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 Point(data); } toJson() { return { 'coordinates': this.coordinates, 'metrics': this.metrics, 'x': this.x, 'y': this.y, }; } clone() { return Point.fromJson(this.toJson()); } } exports.Point = Point; //# sourceMappingURL=Point.js.map