@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
88 lines • 3.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Rectangle = void 0;
class Rectangle {
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 = 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 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 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 0;
}
static getHeightDescription() {
return "Height of the rectangle.";
}
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 0;
}
static getWidthDescription() {
return "Width of the rectangle.";
}
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 Rectangle(data);
}
toJson() {
return {
'coordinates': this.coordinates,
'height': this.height,
'metrics': this.metrics,
'width': this.width,
'x': this.x,
'y': this.y,
};
}
clone() {
return Rectangle.fromJson(this.toJson());
}
}
exports.Rectangle = Rectangle;
//# sourceMappingURL=Rectangle.js.map