@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
170 lines • 9.07 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pdf417Barcode = void 0;
const index_1 = require("./../index");
class Pdf417Barcode {
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 compactDefault = false;
this.compact = typeof (data === null || data === void 0 ? void 0 : data.compact) !== "undefined" ? data === null || data === void 0 ? void 0 : data.compact : compactDefault;
let compactionModeDefault = "auto";
this.compactionMode = typeof (data === null || data === void 0 ? void 0 : data.compactionMode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.compactionMode : compactionModeDefault;
let dataCodewordsMaxDefault = 0;
this.dataCodewordsMax = typeof (data === null || data === void 0 ? void 0 : data.dataCodewordsMax) !== "undefined" ? data === null || data === void 0 ? void 0 : data.dataCodewordsMax : dataCodewordsMaxDefault;
let dataCodewordsMinDefault = 0;
this.dataCodewordsMin = typeof (data === null || data === void 0 ? void 0 : data.dataCodewordsMin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.dataCodewordsMin : dataCodewordsMinDefault;
let errorCorrectionDefault = 2;
this.errorCorrection = typeof (data === null || data === void 0 ? void 0 : data.errorCorrection) !== "undefined" ? data === null || data === void 0 ? void 0 : data.errorCorrection : errorCorrectionDefault;
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 shapeDefault = "default";
this.shape = typeof (data === null || data === void 0 ? void 0 : data.shape) !== "undefined" ? data === null || data === void 0 ? void 0 : data.shape : shapeDefault;
let symbolsPerCodewordMaxDefault = 0;
this.symbolsPerCodewordMax = typeof (data === null || data === void 0 ? void 0 : data.symbolsPerCodewordMax) !== "undefined" ? data === null || data === void 0 ? void 0 : data.symbolsPerCodewordMax : symbolsPerCodewordMaxDefault;
let symbolsPerCodewordMinDefault = 0;
this.symbolsPerCodewordMin = typeof (data === null || data === void 0 ? void 0 : data.symbolsPerCodewordMin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.symbolsPerCodewordMin : symbolsPerCodewordMinDefault;
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 getCompactDefault() {
return false;
}
static getCompactDescription() {
return "If this value is set to \"true,\" the contents of all generated PDF417 barcodes will be compressed using the encoding selected with the \"compactionMode\" attribute.";
}
static getCompactionModeDefault() {
return "auto";
}
static getCompactionModeDescription() {
return "If PDF417 barcode compression has been enabled with the \"compact\" attribute, the encoding selected here for the compression of generated PDF417 barcodes will be used.\n\n* auto = Try to determine the best encoding method automatically.\n* byte = Select a byte encoding method in which every 5 codewords represent 6 bytes.\n* numeric = Select a numeric encoding method in which a group of 15 codewords represents up to 44 decimal numbers.\n* text = Select a text encoding method in which each codeword represents up to 2 letters.";
}
static getDataCodewordsMaxDefault() {
return 0;
}
static getDataCodewordsMaxDescription() {
return "Used to specify the maximum number of codewords allowed in a single PDF417 barcode row.";
}
static getDataCodewordsMaxMin() {
return 1;
}
static getDataCodewordsMinDefault() {
return 0;
}
static getDataCodewordsMinDescription() {
return "Used to specify the minimum number of codewords allowed in a single PDF417 barcode row.";
}
static getDataCodewordsMinMin() {
return 1;
}
static getErrorCorrectionDefault() {
return 2;
}
static getErrorCorrectionDescription() {
return "Used to adjust the error correction level for generated PDF417 codes. The higher the level, the more error-resistant the barcode, ensuring that damaged codes will still be readable. A level of 1 to 8 can be specified.";
}
static getErrorCorrectionMin() {
return 1;
}
static getErrorCorrectionMax() {
return 8;
}
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 getShapeDefault() {
return "default";
}
static getShapeDescription() {
return "Can be used to force a specific shape for generated Data Matrix codes.\n\n* default = The appropriate shape is selected automatically based on the content, character set, and other parameters.\n* rectangle = Force a rectangular shape.\n* square = Force a square shape.";
}
static getSymbolsPerCodewordMaxDefault() {
return 0;
}
static getSymbolsPerCodewordMaxDescription() {
return "Used to specify the maximum number of code symbols that are allowed to be in a single codeword in the PDF417 barcode.";
}
static getSymbolsPerCodewordMaxMin() {
return 1;
}
static getSymbolsPerCodewordMinDefault() {
return 0;
}
static getSymbolsPerCodewordMinDescription() {
return "Used to specify the minimum number of code symbols that are allowed to be in a single codeword in the PDF417 barcode.";
}
static getSymbolsPerCodewordMinMin() {
return 1;
}
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 Pdf417Barcode(data);
}
toJson() {
var _a;
return {
'charset': this.charset,
'compact': this.compact,
'compactionMode': this.compactionMode,
'dataCodewordsMax': this.dataCodewordsMax,
'dataCodewordsMin': this.dataCodewordsMin,
'errorCorrection': this.errorCorrection,
'margin': this.margin,
'pages': this.pages,
'position': (_a = this.position) === null || _a === void 0 ? void 0 : _a.toJson(),
'rotation': this.rotation,
'shape': this.shape,
'symbolsPerCodewordMax': this.symbolsPerCodewordMax,
'symbolsPerCodewordMin': this.symbolsPerCodewordMin,
'value': this.value,
};
}
clone() {
return Pdf417Barcode.fromJson(this.toJson());
}
}
exports.Pdf417Barcode = Pdf417Barcode;
//# sourceMappingURL=Pdf417Barcode.js.map