UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

92 lines 3.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Jpeg = void 0; const index_1 = require("./../index"); class Jpeg { constructor(data) { let dpiDefault = 72; this.dpi = typeof (data === null || data === void 0 ? void 0 : data.dpi) !== "undefined" ? data === null || data === void 0 ? void 0 : data.dpi : dpiDefault; 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 jpegQualityDefault = 80; this.jpegQuality = typeof (data === null || data === void 0 ? void 0 : data.jpegQuality) !== "undefined" ? data === null || data === void 0 ? void 0 : data.jpegQuality : jpegQualityDefault; 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; this.sizeOptimization = index_1.SizeOptimization.fromJson(data === null || data === void 0 ? void 0 : data.sizeOptimization); 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; } static getDpiDefault() { return 72; } static getDpiDescription() { return "This parameter is used to define the image's DPI resolution. The larger the value, the larger the image's x, y resolution. In addition, the larger the DPI resolution, the larger the size of the image file."; } static getDpiMin() { return 0; } static getDpiMax() { return 9600; } static getHeightDefault() { return 0; } static getHeightDescription() { return "Used to limit the maximum height of the exported image. 0 = No restriction"; } static getHeightMin() { return 0; } static getJpegQualityDefault() { return 80; } static getJpegQualityDescription() { return "When exporting to \"jpg\" format, this parameter can be used to define the image's quality as a percentage. The value must fall between 0 and 100. The larger the value, the better the quality and the lower the compression level."; } static getJpegQualityMin() { return 0; } static getJpegQualityMax() { return 100; } 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 getSizeOptimizationDescription() { return ""; } static getWidthDefault() { return 0; } static getWidthDescription() { return "Used to limit the maximum width of the exported image. 0 = No restriction"; } static getWidthMin() { return 0; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new Jpeg(data); } toJson() { var _a; return { 'dpi': this.dpi, 'height': this.height, 'jpegQuality': this.jpegQuality, 'metrics': this.metrics, 'sizeOptimization': (_a = this.sizeOptimization) === null || _a === void 0 ? void 0 : _a.toJson(), 'width': this.width, }; } clone() { return Jpeg.fromJson(this.toJson()); } } exports.Jpeg = Jpeg; //# sourceMappingURL=Jpeg.js.map