@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
72 lines • 3.86 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolboxImageImage = void 0;
const index_1 = require("./../index");
class ToolboxImageImage {
constructor(data) {
this.bmp = index_1.Bmp.fromJson(data === null || data === void 0 ? void 0 : data.bmp);
let fileNameTemplateDefault = "page[%d]";
this.fileNameTemplate = typeof (data === null || data === void 0 ? void 0 : data.fileNameTemplate) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileNameTemplate : fileNameTemplateDefault;
this.gif = index_1.Gif.fromJson(data === null || data === void 0 ? void 0 : data.gif);
this.jpeg = index_1.Jpeg.fromJson(data === null || data === void 0 ? void 0 : data.jpeg);
let pagesDefault = "1";
this.pages = typeof (data === null || data === void 0 ? void 0 : data.pages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pages : pagesDefault;
this.png = index_1.Png.fromJson(data === null || data === void 0 ? void 0 : data.png);
this.svg = index_1.Svg.fromJson(data === null || data === void 0 ? void 0 : data.svg);
this.tiff = index_1.Tiff.fromJson(data === null || data === void 0 ? void 0 : data.tiff);
}
static getBmpDescription() {
return "";
}
static getFileNameTemplateDefault() {
return "page[%d]";
}
static getFileNameTemplateDescription() {
return "When exporting multiple pages, this parameter is used to define the file name that will be used for the generated image files in the ZIP file. The file name must include the string \"%d\". This string will be replaced with a consecutive number in the file name.";
}
static getGifDescription() {
return "";
}
static getJpegDescription() {
return "";
}
static getPagesDefault() {
return "1";
}
static getPagesDescription() {
return "Used to define the page number or page range (e.g., \"1,5-6,9\") that should be converted to an image file format. If only a single page is defined, the image file will be returned directly. If a range of pages is declared, then the call will return a ZIP file containing all the exported pages. The name of the individual image file (when multiple pages are exported) is defined with the \"fileNameTemplate\" attribute. The \"tif\" format is an exception when exporting multiple pages. When using this format, the \"multipage\" attribute can be used to define whether a multipage TIFF will be generated or whether the individual pages will be exported to a ZIP file (as with the other image file formats).";
}
static getPngDescription() {
return "";
}
static getSvgDescription() {
return "";
}
static getTiffDescription() {
return "";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new ToolboxImageImage(data);
}
toJson() {
var _a, _b, _c, _d, _e, _f;
return {
'bmp': (_a = this.bmp) === null || _a === void 0 ? void 0 : _a.toJson(),
'fileNameTemplate': this.fileNameTemplate,
'gif': (_b = this.gif) === null || _b === void 0 ? void 0 : _b.toJson(),
'jpeg': (_c = this.jpeg) === null || _c === void 0 ? void 0 : _c.toJson(),
'pages': this.pages,
'png': (_d = this.png) === null || _d === void 0 ? void 0 : _d.toJson(),
'svg': (_e = this.svg) === null || _e === void 0 ? void 0 : _e.toJson(),
'tiff': (_f = this.tiff) === null || _f === void 0 ? void 0 : _f.toJson(),
};
}
clone() {
return ToolboxImageImage.fromJson(this.toJson());
}
}
exports.ToolboxImageImage = ToolboxImageImage;
//# sourceMappingURL=ToolboxImageImage.js.map