UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

112 lines 6.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ToolboxOptionsOptions = void 0; const index_1 = require("./../index"); class ToolboxOptionsOptions { constructor(data) { this.background = index_1.BackgroundToolboxOptions.fromJson(data === null || data === void 0 ? void 0 : data.background); this.boxes = index_1.BoxesToolboxOptions.fromJson(data === null || data === void 0 ? void 0 : data.boxes); this.headerFooter = index_1.HeaderFooterToolboxOptions.fromJson(data === null || data === void 0 ? void 0 : data.headerFooter); let initialPageDefault = 1; this.initialPage = typeof (data === null || data === void 0 ? void 0 : data.initialPage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.initialPage : initialPageDefault; let initialViewDefault = "none"; this.initialView = typeof (data === null || data === void 0 ? void 0 : data.initialView) !== "undefined" ? data === null || data === void 0 ? void 0 : data.initialView : initialViewDefault; let languageDefault = ""; this.language = typeof (data === null || data === void 0 ? void 0 : data.language) !== "undefined" ? data === null || data === void 0 ? void 0 : data.language : languageDefault; let magnificationDefault = "fitWidth"; this.magnification = typeof (data === null || data === void 0 ? void 0 : data.magnification) !== "undefined" ? data === null || data === void 0 ? void 0 : data.magnification : magnificationDefault; let magnificationZoomDefault = 100; this.magnificationZoom = typeof (data === null || data === void 0 ? void 0 : data.magnificationZoom) !== "undefined" ? data === null || data === void 0 ? void 0 : data.magnificationZoom : magnificationZoomDefault; let pageLayoutDefault = "singlePage"; this.pageLayout = typeof (data === null || data === void 0 ? void 0 : data.pageLayout) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pageLayout : pageLayoutDefault; this.pageTransitions = index_1.PageTransitionsToolboxOptions.fromJson(data === null || data === void 0 ? void 0 : data.pageTransitions); this.viewerPreferences = index_1.ViewerPreferences.fromJson(data === null || data === void 0 ? void 0 : data.viewerPreferences); } static getBackgroundDescription() { return ""; } static getBoxesDescription() { return ""; } static getHeaderFooterDescription() { return ""; } static getInitialPageDefault() { return 1; } static getInitialPageDescription() { return "Defines the page that will be shown when the document is opened."; } static getInitialPageMin() { return 1; } static getInitialViewDefault() { return "none"; } static getInitialViewDescription() { return "Defines which sub-windows will be opened when the PDF document is opened.\n\n* none = No special view\n* outlines = Opens the \"Bookmarks\" tab\n* thumbnails = Opens the \"Thumbnails\" tab\n* fullscreen = Opens the document in full screen mode"; } static getLanguageDefault() { return ""; } static getLanguageDescription() { return "Specifies the language (and optionally the country) for the content of the document. The value is encoded as RFC 3066 (Tags for the Identification of Languages) and includes either the language only (e.g. \"de\") or the language and a country identifier (e.g. \"de-DE\")."; } static getMagnificationDefault() { return "fitWidth"; } static getMagnificationDescription() { return "Sets the zoom settings according to a defined mode.\n\n* none = Uses the application's default view\n* fitWidth = Page width\n* fitPage = Page dimensions\n* fitHeight = Page height\n* fitVisible = Page content width\n* fitActual = Uses the original page dimensions (100% zoom factor)\n* zoom = Sets an explicit magnification value"; } static getMagnificationZoomDefault() { return 100; } static getMagnificationZoomDescription() { return "Used to set the value for zooming."; } static getMagnificationZoomMin() { return 0; } static getMagnificationZoomMax() { return 6400; } static getPageLayoutDefault() { return "singlePage"; } static getPageLayoutDescription() { return "Sets the page layout when the PDF document is opened.\n\n* singlePage = Individual pages\n* singlePageContinous = Continuous individual pages\n* twoPages = double pages starting with odd pages\n* twoPagesRight = double pages starting with even pages\n* twoPagesContinous = continuous double pages starting with odd pages\n* twoPagesContinousRight = continuous double pages starting with even pages"; } static getPageTransitionsDescription() { return ""; } static getViewerPreferencesDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new ToolboxOptionsOptions(data); } toJson() { var _a, _b, _c, _d, _e; return { 'background': (_a = this.background) === null || _a === void 0 ? void 0 : _a.toJson(), 'boxes': (_b = this.boxes) === null || _b === void 0 ? void 0 : _b.toJson(), 'headerFooter': (_c = this.headerFooter) === null || _c === void 0 ? void 0 : _c.toJson(), 'initialPage': this.initialPage, 'initialView': this.initialView, 'language': this.language, 'magnification': this.magnification, 'magnificationZoom': this.magnificationZoom, 'pageLayout': this.pageLayout, 'pageTransitions': (_d = this.pageTransitions) === null || _d === void 0 ? void 0 : _d.toJson(), 'viewerPreferences': (_e = this.viewerPreferences) === null || _e === void 0 ? void 0 : _e.toJson(), }; } clone() { return ToolboxOptionsOptions.fromJson(this.toJson()); } } exports.ToolboxOptionsOptions = ToolboxOptionsOptions; //# sourceMappingURL=ToolboxOptionsOptions.js.map