UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

110 lines 5.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AztecBarcode = void 0; const index_1 = require("./../index"); class AztecBarcode { constructor(data) { let charsetDefault = "utf-8"; this.charset = typeof (data === null || data === void 0 ? void 0 : data.charset) !== "undefined" ? data === null || data === void 0 ? void 0 : data.charset : charsetDefault; let errorCorrectionDefault = 7; this.errorCorrection = typeof (data === null || data === void 0 ? void 0 : data.errorCorrection) !== "undefined" ? data === null || data === void 0 ? void 0 : data.errorCorrection : errorCorrectionDefault; let layersDefault = 0; this.layers = typeof (data === null || data === void 0 ? void 0 : data.layers) !== "undefined" ? data === null || data === void 0 ? void 0 : data.layers : layersDefault; let marginDefault = 0; this.margin = typeof (data === null || data === void 0 ? void 0 : data.margin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.margin : marginDefault; let pagesDefault = ""; this.pages = typeof (data === null || data === void 0 ? void 0 : data.pages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pages : pagesDefault; this.position = index_1.Rectangle.fromJson(data === null || data === void 0 ? void 0 : data.position); let rotationDefault = 0; this.rotation = typeof (data === null || data === void 0 ? void 0 : data.rotation) !== "undefined" ? data === null || data === void 0 ? void 0 : data.rotation : rotationDefault; let valueDefault = ""; this.value = typeof data.value !== "undefined" ? data.value : valueDefault; } static getCharsetDefault() { return "utf-8"; } static getCharsetDescription() { return "Used to specify the character set in which the barcode contents should be stored."; } static getErrorCorrectionDefault() { return 7; } static getErrorCorrectionDescription() { return "Used to adjust the error correction level for generated Aztec Codes. The higher the level, the more error-resistant the barcode, ensuring that damaged codes will still be readable. A percentage value of one to one hundred can be entered."; } static getErrorCorrectionMin() { return 1; } static getErrorCorrectionMax() { return 100; } static getLayersDefault() { return 0; } static getLayersDescription() { return "Used to specify the number of layers that the generated Aztec Code should use. The higher the number, the larger the resulting barcode and its capacity.\n\n* \"-4\" to \"-1\" = Compact Aztec Code with a minimum capacity of 13 digits or 12 letters and an area of 15 x 15 pixels.\n* \"0\" = Standard Aztec Code that will be optimized in order to use the smallest possible of layers for the value that is being encoded.\n* \"1\" to \"32\" = Standard Aztec Code with a maximum capacity of 3832 digits or 3067 letters and an area of 151 x 151 pixels."; } static getLayersMin() { return -4; } static getLayersMax() { return 32; } static getMarginDefault() { return 0; } static getMarginDescription() { return "Used to specify the width of the empty frame that should be generated around the barcode. This shall use the same metrics as the position - if no position is present, the default (mm) shall be assumed."; } static getMarginMin() { return 0; } static getPagesDefault() { return ""; } static getPagesDescription() { return "The page range for generating barcodes. Individual pages or a range of pages can be defined here. If the text is empty, the entire file will be exported (e.g.: \"1-10\" or \"1,2,5-10\")"; } static getPositionDescription() { return ""; } static getRotationDefault() { return 0; } static getRotationDescription() { return "Used to specify the barcode's rotation in 90-degree increments. When there is a value that falls under a full 90-degree increment, the next higher increment will be automatically selected."; } static getRotationMin() { return 0; } static getValueDefault() { return ""; } static getValueDescription() { return "Contains the value that should be encoded in the barcode. Depending on the selected barcode format, there may be specific criteria for the data structure. For a description, please refer to the chapter \"Barcodes\""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new AztecBarcode(data); } toJson() { var _a; return { 'charset': this.charset, 'errorCorrection': this.errorCorrection, 'layers': this.layers, 'margin': this.margin, 'pages': this.pages, 'position': (_a = this.position) === null || _a === void 0 ? void 0 : _a.toJson(), 'rotation': this.rotation, 'value': this.value, }; } clone() { return AztecBarcode.fromJson(this.toJson()); } } exports.AztecBarcode = AztecBarcode; //# sourceMappingURL=AztecBarcode.js.map