UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

75 lines 3.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HeaderFooter = void 0; const index_1 = require("./../index"); class HeaderFooter { constructor(data) { this.date = index_1.HeaderFooterDate.fromJson(data === null || data === void 0 ? void 0 : data.date); let firstPageNumberDefault = 1; this.firstPageNumber = typeof (data === null || data === void 0 ? void 0 : data.firstPageNumber) !== "undefined" ? data === null || data === void 0 ? void 0 : data.firstPageNumber : firstPageNumberDefault; this.font = index_1.OptionsFont.fromJson(data === null || data === void 0 ? void 0 : data.font); this.footer = index_1.HeaderFooterPositions.fromJson(data === null || data === void 0 ? void 0 : data.footer); this.header = index_1.HeaderFooterPositions.fromJson(data === null || data === void 0 ? void 0 : data.header); this.margin = index_1.OptionsMargin.fromJson(data === null || data === void 0 ? void 0 : data.margin); this.pages = index_1.PagesHeaderFooter.fromJson(data === null || data === void 0 ? void 0 : data.pages); let replaceExistingDefault = false; this.replaceExisting = typeof (data === null || data === void 0 ? void 0 : data.replaceExisting) !== "undefined" ? data === null || data === void 0 ? void 0 : data.replaceExisting : replaceExistingDefault; } static getDateDescription() { return ""; } static getFirstPageNumberDefault() { return 1; } static getFirstPageNumberDescription() { return "Used to specify the starting page for page number formats."; } static getFirstPageNumberMin() { return 1; } static getFontDescription() { return ""; } static getFooterDescription() { return ""; } static getHeaderDescription() { return ""; } static getMarginDescription() { return ""; } static getPagesDescription() { return ""; } static getReplaceExistingDefault() { return false; } static getReplaceExistingDescription() { return "If true, preexisting header and footer definition will be automatically deleted from all pages of the document and replaced with the new one. If false, preexisting header and footer definitions on any page of the document will cause the operation to be aborted."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new HeaderFooter(data); } toJson() { var _a, _b, _c, _d, _e, _f; return { 'date': (_a = this.date) === null || _a === void 0 ? void 0 : _a.toJson(), 'firstPageNumber': this.firstPageNumber, 'font': (_b = this.font) === null || _b === void 0 ? void 0 : _b.toJson(), 'footer': (_c = this.footer) === null || _c === void 0 ? void 0 : _c.toJson(), 'header': (_d = this.header) === null || _d === void 0 ? void 0 : _d.toJson(), 'margin': (_e = this.margin) === null || _e === void 0 ? void 0 : _e.toJson(), 'pages': (_f = this.pages) === null || _f === void 0 ? void 0 : _f.toJson(), 'replaceExisting': this.replaceExisting, }; } clone() { return HeaderFooter.fromJson(this.toJson()); } } exports.HeaderFooter = HeaderFooter; //# sourceMappingURL=HeaderFooter.js.map