UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

74 lines 3.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetadataHeaderFooter = void 0; const index_1 = require("./../index"); class MetadataHeaderFooter { constructor(data) { let colorDefault = ""; this.color = typeof (data === null || data === void 0 ? void 0 : data.color) !== "undefined" ? data === null || data === void 0 ? void 0 : data.color : colorDefault; this.font = index_1.Font.fromJson(data.font); this.footer = index_1.FooterHeaderFooter.fromJson(data === null || data === void 0 ? void 0 : data.footer); this.header = index_1.HeaderHeaderFooter.fromJson(data === null || data === void 0 ? void 0 : data.header); this.margin = index_1.Margin.fromJson(data.margin); 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; } static getColorDefault() { return ""; } static getColorDescription() { return "The text of headers and footers color."; } static getFontDescription() { return ""; } static getFooterDescription() { return ""; } static getHeaderDescription() { return ""; } static getMarginDescription() { return ""; } static getObjectKeyDefault() { return ""; } static getObjectKeyDescription() { return "The object ID of the header\/footer 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 page headers\/footers shall be defined for."; } static getPageMin() { return 0; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new MetadataHeaderFooter(data); } toJson() { var _a, _b, _c, _d; return { 'color': this.color, 'font': (_a = this.font) === null || _a === void 0 ? void 0 : _a.toJson(), 'footer': (_b = this.footer) === null || _b === void 0 ? void 0 : _b.toJson(), 'header': (_c = this.header) === null || _c === void 0 ? void 0 : _c.toJson(), 'margin': (_d = this.margin) === null || _d === void 0 ? void 0 : _d.toJson(), 'objectKey': this.objectKey, 'page': this.page, }; } clone() { return MetadataHeaderFooter.fromJson(this.toJson()); } } exports.MetadataHeaderFooter = MetadataHeaderFooter; //# sourceMappingURL=MetadataHeaderFooter.js.map