UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

82 lines 3.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BackgroundContent = void 0; const index_1 = require("./../index"); class BackgroundContent { constructor(data) { this.bounds = index_1.MetadataRectangle.fromJson(data.bounds); let isImageDefault = false; this.isImage = typeof (data === null || data === void 0 ? void 0 : data.isImage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isImage : isImageDefault; 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 onprintDefault = true; this.onprint = typeof (data === null || data === void 0 ? void 0 : data.onprint) !== "undefined" ? data === null || data === void 0 ? void 0 : data.onprint : onprintDefault; let onscreenDefault = true; this.onscreen = typeof (data === null || data === void 0 ? void 0 : data.onscreen) !== "undefined" ? data === null || data === void 0 ? void 0 : data.onscreen : onscreenDefault; 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; this.pieceInfo = index_1.PieceInfoBackgroundContent.fromJson(data === null || data === void 0 ? void 0 : data.pieceInfo); } static getBoundsDescription() { return ""; } static getIsImageDefault() { return false; } static getIsImageDescription() { return "When set to true, the background is using an image resource. (Otherwise it is unicolor)"; } static getObjectKeyDefault() { return ""; } static getObjectKeyDescription() { return "The object ID of the background. **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 getOnprintDefault() { return true; } static getOnprintDescription() { return "Whether the background shall be visible in printouts of the document."; } static getOnscreenDefault() { return true; } static getOnscreenDescription() { return "Whether the background shall be visible in Readers."; } static getPageDefault() { return 0; } static getPageDescription() { return "The page the background shall be set for."; } static getPageMin() { return 0; } static getPieceInfoDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new BackgroundContent(data); } toJson() { var _a, _b; return { 'bounds': (_a = this.bounds) === null || _a === void 0 ? void 0 : _a.toJson(), 'isImage': this.isImage, 'objectKey': this.objectKey, 'onprint': this.onprint, 'onscreen': this.onscreen, 'page': this.page, 'pieceInfo': (_b = this.pieceInfo) === null || _b === void 0 ? void 0 : _b.toJson(), }; } clone() { return BackgroundContent.fromJson(this.toJson()); } } exports.BackgroundContent = BackgroundContent; //# sourceMappingURL=BackgroundContent.js.map