UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

74 lines 4.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScalePagesToolboxScale = void 0; const index_1 = require("./../index"); class ScalePagesToolboxScale { constructor(data) { this.dimensions = index_1.PaddedRectangle.fromJson(data === null || data === void 0 ? void 0 : data.dimensions); let horizontalAlignmentDefault = "left"; this.horizontalAlignment = typeof (data === null || data === void 0 ? void 0 : data.horizontalAlignment) !== "undefined" ? data === null || data === void 0 ? void 0 : data.horizontalAlignment : horizontalAlignmentDefault; let pagesDefault = ""; this.pages = typeof (data === null || data === void 0 ? void 0 : data.pages) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pages : pagesDefault; let preserveAspectRatioDefault = true; this.preserveAspectRatio = typeof (data === null || data === void 0 ? void 0 : data.preserveAspectRatio) !== "undefined" ? data === null || data === void 0 ? void 0 : data.preserveAspectRatio : preserveAspectRatioDefault; let scaleBoxesDefault = true; this.scaleBoxes = typeof (data === null || data === void 0 ? void 0 : data.scaleBoxes) !== "undefined" ? data === null || data === void 0 ? void 0 : data.scaleBoxes : scaleBoxesDefault; let verticalAlignmentDefault = "top"; this.verticalAlignment = typeof (data === null || data === void 0 ? void 0 : data.verticalAlignment) !== "undefined" ? data === null || data === void 0 ? void 0 : data.verticalAlignment : verticalAlignmentDefault; } static getDimensionsDescription() { return ""; } static getHorizontalAlignmentDefault() { return "left"; } static getHorizontalAlignmentDescription() { return "If margins are created when the page is scaled or if the page content must be positioned relative to a context (for example, the crop box), this value specifies how margins are to be split and how overall page content is to be positioned on the page.\n\n* left = Contents are to be arranged left-justified.\n* center = Content should be centered.\n* right = Contents should be arranged right-justified."; } static getPagesDefault() { return ""; } static getPagesDescription() { return "Specifies which page(s) should be scaled. The page number can be either a single page, a range of pages or a list (separated by commas) (e.g. \"1.5-6.9\"). The specification of all pages is done with \"\\*\"."; } static getPreserveAspectRatioDefault() { return true; } static getPreserveAspectRatioDescription() { return "Specifies whether the ratio of the page dimensions to each other should be maintained when scaling the page. This may result in deviations from the given target height or width (depending on requirements)."; } static getScaleBoxesDefault() { return true; } static getScaleBoxesDescription() { return "Specifies whether the scaling of the page should also affect the boxes (Mediabox, Cropbox, etc.) of a page. If this is not the case (false), the actual page dimensions, crop boxes, etc. remain as they were originally and only page contents are scaled. The content can become much smaller or larger than the containing page in this way, which can lead to either large blank areas or overflow of the page content."; } static getVerticalAlignmentDefault() { return "top"; } static getVerticalAlignmentDescription() { return "If margins are created when the page is scaled or if the page content must be positioned relative to a context (for example, the crop box), this value specifies how margins are to be split and how overall page content is to be positioned on the page.\n\n* top = Content should be positioned at the top of the page.\n* center = Content should be centered.\n* bottom = content should be positioned at the bottom."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new ScalePagesToolboxScale(data); } toJson() { var _a; return { 'dimensions': (_a = this.dimensions) === null || _a === void 0 ? void 0 : _a.toJson(), 'horizontalAlignment': this.horizontalAlignment, 'pages': this.pages, 'preserveAspectRatio': this.preserveAspectRatio, 'scaleBoxes': this.scaleBoxes, 'verticalAlignment': this.verticalAlignment, }; } clone() { return ScalePagesToolboxScale.fromJson(this.toJson()); } } exports.ScalePagesToolboxScale = ScalePagesToolboxScale; //# sourceMappingURL=ScalePagesToolboxScale.js.map