UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

178 lines 12.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ViewerPreferences = void 0; class ViewerPreferences { constructor(data) { let centerWindowDefault = false; this.centerWindow = typeof (data === null || data === void 0 ? void 0 : data.centerWindow) !== "undefined" ? data === null || data === void 0 ? void 0 : data.centerWindow : centerWindowDefault; let displayDocTitleDefault = false; this.displayDocTitle = typeof (data === null || data === void 0 ? void 0 : data.displayDocTitle) !== "undefined" ? data === null || data === void 0 ? void 0 : data.displayDocTitle : displayDocTitleDefault; let duplexDefault = "none"; this.duplex = typeof (data === null || data === void 0 ? void 0 : data.duplex) !== "undefined" ? data === null || data === void 0 ? void 0 : data.duplex : duplexDefault; let fitWindowDefault = false; this.fitWindow = typeof (data === null || data === void 0 ? void 0 : data.fitWindow) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fitWindow : fitWindowDefault; let hideMenuBarDefault = false; this.hideMenuBar = typeof (data === null || data === void 0 ? void 0 : data.hideMenuBar) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hideMenuBar : hideMenuBarDefault; let hideToolbarDefault = false; this.hideToolbar = typeof (data === null || data === void 0 ? void 0 : data.hideToolbar) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hideToolbar : hideToolbarDefault; let hideWindowUIDefault = false; this.hideWindowUI = typeof (data === null || data === void 0 ? void 0 : data.hideWindowUI) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hideWindowUI : hideWindowUIDefault; let nonFullScreenPageModeDefault = "none"; this.nonFullScreenPageMode = typeof (data === null || data === void 0 ? void 0 : data.nonFullScreenPageMode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.nonFullScreenPageMode : nonFullScreenPageModeDefault; let numCopiesDefault = 1; this.numCopies = typeof (data === null || data === void 0 ? void 0 : data.numCopies) !== "undefined" ? data === null || data === void 0 ? void 0 : data.numCopies : numCopiesDefault; let printAreaDefault = "crop_box"; this.printArea = typeof (data === null || data === void 0 ? void 0 : data.printArea) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printArea : printAreaDefault; let printClipDefault = "crop_box"; this.printClip = typeof (data === null || data === void 0 ? void 0 : data.printClip) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printClip : printClipDefault; let printPageRangeDefault = ""; this.printPageRange = typeof (data === null || data === void 0 ? void 0 : data.printPageRange) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printPageRange : printPageRangeDefault; let printScalingDefault = "readerDefault"; this.printScaling = typeof (data === null || data === void 0 ? void 0 : data.printScaling) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printScaling : printScalingDefault; let printTraySelectionDefault = "readerDefault"; this.printTraySelection = typeof (data === null || data === void 0 ? void 0 : data.printTraySelection) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printTraySelection : printTraySelectionDefault; let textDirectionDefault = "leftToRight"; this.textDirection = typeof (data === null || data === void 0 ? void 0 : data.textDirection) !== "undefined" ? data === null || data === void 0 ? void 0 : data.textDirection : textDirectionDefault; let viewAreaDefault = "crop_box"; this.viewArea = typeof (data === null || data === void 0 ? void 0 : data.viewArea) !== "undefined" ? data === null || data === void 0 ? void 0 : data.viewArea : viewAreaDefault; let viewClipDefault = "crop_box"; this.viewClip = typeof (data === null || data === void 0 ? void 0 : data.viewClip) !== "undefined" ? data === null || data === void 0 ? void 0 : data.viewClip : viewClipDefault; } static getCenterWindowDefault() { return false; } static getCenterWindowDescription() { return "If true, the PDF reader window is moved to the center of the screen."; } static getDisplayDocTitleDefault() { return false; } static getDisplayDocTitleDescription() { return "If true, the document title of the document is displayed in the title bar of the PDF reader instead of the file name."; } static getDuplexDefault() { return "none"; } static getDuplexDescription() { return "Sets whether and how pages are to be printed on both sides. (This setting is only a dialog default and can be changed by the user at any time).\n\n* simplex = Print on one side.\n* duplexFlipLongEdge = Print on both sides and flip over the longer edge of the page.\n* duplexFlipShortEdge = Print on both sides and flip over the shorter side edge.\n* none = Use the default settings of the display program."; } static getFitWindowDefault() { return false; } static getFitWindowDescription() { return "If true, the window size of the PDF reader will be tried to fit the first page of the document."; } static getHideMenuBarDefault() { return false; } static getHideMenuBarDescription() { return "If true, the menu bars of the PDF reader are hidden for the display of this document."; } static getHideToolbarDefault() { return false; } static getHideToolbarDescription() { return "If true, the toolbars of the PDF reader are hidden for the display of this document."; } static getHideWindowUIDefault() { return false; } static getHideWindowUIDescription() { return "If true, the scrollbars and other navigation features of the PDF reader are hidden for the display of this document."; } static getNonFullScreenPageModeDefault() { return "none"; } static getNonFullScreenPageModeDescription() { return "Konfiguriert die Anzeige des Dokuments, wenn das Dokument nicht im Vollbildmodus betrachtet wird. Dies konfiguriert in erste Linie welche Navigationsansicht f\u00FCr den Betrachter ge\u00F6ffnet werden soll.\n\n* none = Weder die Inhalts\u00FCbersicht, noch die Miniaturansicht der Seiten sollen angezeigt werden.\n* outlines = Die Inhalts\u00FCbersicht des Dokuments soll angezeigt werden.\n* thumbnails = Die Miniaturansicht der Seiten des Dokuments soll angezeigt werden.\n* optionalContents = Die Layer (Optional Content Groups) des Dokuments sollen angezeigt werden."; } static getNumCopiesDefault() { return 1; } static getNumCopiesDescription() { return "Specifies how many copies of the document are to be printed. (This setting is only a dialog default and can be changed by the user at any time)."; } static getNumCopiesMin() { return 1; } static getPrintAreaDefault() { return "crop_box"; } static getPrintAreaDescription() { return "Used to select the box that should be scaled.\n\n* media\\_box = The page's physical dimensions.\n* crop\\_box = The visible (printable) page area.\n* bleed\\_box = Untrimmed content position on the page (content dimensions plus trim box).\n* trim\\_box = Trimmed content position on the page (final content dimensions).\n* art\\_box = Position for special page content (images)."; } static getPrintClipDefault() { return "crop_box"; } static getPrintClipDescription() { return "Used to select the box that should be scaled.\n\n* media\\_box = The page's physical dimensions.\n* crop\\_box = The visible (printable) page area.\n* bleed\\_box = Untrimmed content position on the page (content dimensions plus trim box).\n* trim\\_box = Trimmed content position on the page (final content dimensions).\n* art\\_box = Position for special page content (images)."; } static getPrintPageRangeDefault() { return ""; } static getPrintPageRangeDescription() { return "Specifies which page(s) to print. For the page number, either a single page, a range of pages or a list (separated by commas) can be specified (e.g. \"1,5-6,9\"). The specification of all pages is done with \"\\*\". (This setting is only a dialog default and can be changed by the user at any time)."; } static getPrintScalingDefault() { return "readerDefault"; } static getPrintScalingDescription() { return "Selects the page\n\n* scaling mode for printouts of the document. (This setting is only a dialog default and can be changed by the user at any time).\n* readerDefault = Use the scaling functions provided by the display program.\n* noPrintScaling = Do no page scaling and print the pages in original size."; } static getPrintTraySelectionDefault() { return "readerDefault"; } static getPrintTraySelectionDescription() { return "Selects the default setting for how print trays should be selected for printing the pages of the document. (This setting is only a dialog default and can be changed by the user at any time).\n\n* readerDefault = Use the default settings of the display program.\n* byPDFSize = Try to determine the necessary paper size and the used print tray automatically based on the size of the pages of the document."; } static getTextDirectionDefault() { return "leftToRight"; } static getTextDirectionDescription() { return "Specifies the text reading direction for the display program's read aloud.\n\n* leftToRight = From left to right.\n* rightToLeft = From right to left. (Including vertical fonts, such as: Chinese, Japanese, Korean, etc.)."; } static getViewAreaDefault() { return "crop_box"; } static getViewAreaDescription() { return "Used to select the box that should be scaled.\n\n* media\\_box = The page's physical dimensions.\n* crop\\_box = The visible (printable) page area.\n* bleed\\_box = Untrimmed content position on the page (content dimensions plus trim box).\n* trim\\_box = Trimmed content position on the page (final content dimensions).\n* art\\_box = Position for special page content (images)."; } static getViewClipDefault() { return "crop_box"; } static getViewClipDescription() { return "Used to select the box that should be scaled.\n\n* media\\_box = The page's physical dimensions.\n* crop\\_box = The visible (printable) page area.\n* bleed\\_box = Untrimmed content position on the page (content dimensions plus trim box).\n* trim\\_box = Trimmed content position on the page (final content dimensions).\n* art\\_box = Position for special page content (images)."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new ViewerPreferences(data); } toJson() { return { 'centerWindow': this.centerWindow, 'displayDocTitle': this.displayDocTitle, 'duplex': this.duplex, 'fitWindow': this.fitWindow, 'hideMenuBar': this.hideMenuBar, 'hideToolbar': this.hideToolbar, 'hideWindowUI': this.hideWindowUI, 'nonFullScreenPageMode': this.nonFullScreenPageMode, 'numCopies': this.numCopies, 'printArea': this.printArea, 'printClip': this.printClip, 'printPageRange': this.printPageRange, 'printScaling': this.printScaling, 'printTraySelection': this.printTraySelection, 'textDirection': this.textDirection, 'viewArea': this.viewArea, 'viewClip': this.viewClip, }; } clone() { return ViewerPreferences.fromJson(this.toJson()); } } exports.ViewerPreferences = ViewerPreferences; //# sourceMappingURL=ViewerPreferences.js.map