@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
55 lines • 2.87 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SvgFormat = void 0;
class SvgFormat {
constructor(data) {
let decimalPrecisionDefault = 2;
this.decimalPrecision = typeof (data === null || data === void 0 ? void 0 : data.decimalPrecision) !== "undefined" ? data === null || data === void 0 ? void 0 : data.decimalPrecision : decimalPrecisionDefault;
let graphicsStateModeDefault = "centralize";
this.graphicsStateMode = typeof (data === null || data === void 0 ? void 0 : data.graphicsStateMode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.graphicsStateMode : graphicsStateModeDefault;
let pathDrawModeDefault = "compact";
this.pathDrawMode = typeof (data === null || data === void 0 ? void 0 : data.pathDrawMode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pathDrawMode : pathDrawModeDefault;
}
static getDecimalPrecisionDefault() {
return 2;
}
static getDecimalPrecisionDescription() {
return "Selects the number of decimal places for numeric values of contained SVGs.\n\n**Important:** The number of decimal places directly influences the size of the resulting file. (should SVGs be contained.) However: Higher values will result in a better SVG quality.";
}
static getDecimalPrecisionMin() {
return 0;
}
static getDecimalPrecisionMax() {
return 10;
}
static getGraphicsStateModeDefault() {
return "centralize";
}
static getGraphicsStateModeDescription() {
return "Selects the SVG syntax used for formatting graphics states.\n\n* verbose = Writes verbose graphics states and groups and always prefers direct path definitions.\n* centralize = Writes compact graphics states and groups and centralizes formatting instructions, also utilizes the \"use\" syntax to prepare and reference indirect paths. (May not be readable by some SVG viewers.)";
}
static getPathDrawModeDefault() {
return "compact";
}
static getPathDrawModeDescription() {
return "Selects the SVG syntax used for formatting paths.\n\n* verbose = Writes verbose paths, containing a human readable complete and simple syntax.\n* compress = Compresses path draw instructions, by applying the EBNF (Extended Backus Naur Form).";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new SvgFormat(data);
}
toJson() {
return {
'decimalPrecision': this.decimalPrecision,
'graphicsStateMode': this.graphicsStateMode,
'pathDrawMode': this.pathDrawMode,
};
}
clone() {
return SvgFormat.fromJson(this.toJson());
}
}
exports.SvgFormat = SvgFormat;
//# sourceMappingURL=SvgFormat.js.map