@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
82 lines • 3.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Image = void 0;
class Image {
constructor(data) {
let bitsPerComponentDefault = 0;
this.bitsPerComponent = typeof (data === null || data === void 0 ? void 0 : data.bitsPerComponent) !== "undefined" ? data === null || data === void 0 ? void 0 : data.bitsPerComponent : bitsPerComponentDefault;
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 objectKeyDefault = "";
this.objectKey = typeof (data === null || data === void 0 ? void 0 : data.objectKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.objectKey : objectKeyDefault;
let pageDefault = 0;
this.page = typeof (data === null || data === void 0 ? void 0 : data.page) !== "undefined" ? data === null || data === void 0 ? void 0 : data.page : pageDefault;
let suffixDefault = "";
this.suffix = typeof (data === null || data === void 0 ? void 0 : data.suffix) !== "undefined" ? data === null || data === void 0 ? void 0 : data.suffix : suffixDefault;
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 getBitsPerComponentDefault() {
return 0;
}
static getBitsPerComponentDescription() {
return "The number of bits used to encode one color component.";
}
static getBitsPerComponentMin() {
return 0;
}
static getHeightDefault() {
return 0;
}
static getHeightDescription() {
return "The height of the image in points.";
}
static getObjectKeyDefault() {
return "";
}
static getObjectKeyDescription() {
return "The object ID of the image resource definition. **Info:** A PDF object ID consists of two numbers, where the first number selects the object's number and the second the \"generation\" of the object. The object ID shall always be unique within the context of the document and can be used to select a specific object.";
}
static getPageDefault() {
return 0;
}
static getPageDescription() {
return "The number of the page containing the image resource.";
}
static getPageMin() {
return 0;
}
static getSuffixDefault() {
return "";
}
static getSuffixDescription() {
return "Returns the file type suffix of the image. (This suffix depends on the used image encoding and therefore is highly reliable.)";
}
static getWidthDefault() {
return 0;
}
static getWidthDescription() {
return "The width of the image in points.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new Image(data);
}
toJson() {
return {
'bitsPerComponent': this.bitsPerComponent,
'height': this.height,
'objectKey': this.objectKey,
'page': this.page,
'suffix': this.suffix,
'width': this.width,
};
}
clone() {
return Image.fromJson(this.toJson());
}
}
exports.Image = Image;
//# sourceMappingURL=Image.js.map