UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

112 lines 5.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Tiff = void 0; class Tiff { constructor(data) { let blackAndWhiteQualityDefault = "high"; this.blackAndWhiteQuality = typeof (data === null || data === void 0 ? void 0 : data.blackAndWhiteQuality) !== "undefined" ? data === null || data === void 0 ? void 0 : data.blackAndWhiteQuality : blackAndWhiteQualityDefault; let compressionDefault = "none"; this.compression = typeof (data === null || data === void 0 ? void 0 : data.compression) !== "undefined" ? data === null || data === void 0 ? void 0 : data.compression : compressionDefault; 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; let multipageDefault = false; this.multipage = typeof (data === null || data === void 0 ? void 0 : data.multipage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.multipage : multipageDefault; 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 getBlackAndWhiteQualityDefault() { return "high"; } static getBlackAndWhiteQualityDescription() { return "For \"tif\" exports, this parameter is used to define the quality of black-and-white images if \"group3\" or \"group4\" is used as a compression method. The higher the quality, the more time that will be required in order to render the image:\n\n* low = Direct conversion (best reserved for \"text only\" content)\n* middle = A diffusion filter will be applied to the image before conversion\n* high = Greyscale conversion and a diffusion filter will be applied to the image before conversion"; } static getCompressionDefault() { return "none"; } static getCompressionDescription() { return "This parameter is used to specify the compression method when exporting pages as \"tif\" images. The following values are available:\n\n* none = No compression\n* rle = TIFF CCITT Modified Huffman RLE compression\n* deflate = TIFF Deflate lossless compression (Zip-in-TIFF).\n* group3 = TIFF CCITT Group 3 fax encoding\n* group4 = TIFF CCITT Group 4 fax encoding\n* jpeg = TIFF JPEG-in-TIFF compression\n* lzw = TIFF LZW compression\n* packbits = TIFF Byte-oriented run-length encoding \"PackBits\" compression\n* zlib = TIFF ZLib compression"; } 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 getMultipageDefault() { return false; } static getMultipageDescription() { return "If \"true,\" a \"multi-page TIFF\" will be created when multiple pages are exported as \"tif\" images. All the pages will be exported to a single file, and a ZIP file with individual images will not be generated."; } 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 Tiff(data); } toJson() { return { 'blackAndWhiteQuality': this.blackAndWhiteQuality, 'compression': this.compression, 'dpi': this.dpi, 'height': this.height, 'jpegQuality': this.jpegQuality, 'metrics': this.metrics, 'multipage': this.multipage, 'width': this.width, }; } clone() { return Tiff.fromJson(this.toJson()); } } exports.Tiff = Tiff; //# sourceMappingURL=Tiff.js.map