UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

178 lines 11.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetadataViewerPreferences = void 0; class MetadataViewerPreferences { 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 = "cropBox"; 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 = "cropBox"; 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 = "cropBox"; 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 = "cropBox"; 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 "The Reader's window shall be positioned at the center of the screen, when opening the document."; } static getDisplayDocTitleDefault() { return false; } static getDisplayDocTitleDescription() { return "Instead of the file name the reader shall display the title of the document in it's title bar."; } static getDuplexDefault() { return "none"; } static getDuplexDescription() { return "The duplex settings initially suggested when opening the Reader's print dialog.\n\n* none = The Reader shall use it's default suggestion.\n* simplex = The Reader shall suggest simplex printing.\n* duplexFlipShortEdge = The Reader shall suggest duplex printing, flipping pages over the shorter edge.\n* duplexFlipLongEdge = The Reader shall suggest duplex printing, flipping pages over the longer edge."; } static getFitWindowDefault() { return false; } static getFitWindowDescription() { return "The dimensions of the Reader's window shall adapt to the first displayed page of the document."; } static getHideMenuBarDefault() { return false; } static getHideMenuBarDescription() { return "The Reader's menu bar shall be hidden, when opening the document."; } static getHideToolbarDefault() { return false; } static getHideToolbarDescription() { return "The Reader's toolbars shall be hidden, when opening the document."; } static getHideWindowUIDefault() { return false; } static getHideWindowUIDescription() { return "The Reader's navigation controls (such as scrollbars) shall be hidden, when opening the document."; } static getNonFullScreenPageModeDefault() { return "none"; } static getNonFullScreenPageModeDescription() { return "When displaying a document in windowed mode, the Reader shall show the selected panel.\n\n* none = No panel shall be opened.\n* outlines = The document's outlines shall be displayed.\n* thumbnails = The document's page thumbnails shall be shown.\n* optionalContents = document's layers (OCGs - Optional Content Groups) shall be displayed."; } static getNumCopiesDefault() { return 1; } static getNumCopiesDescription() { return "The number of copies initially suggested, when opening the Reader's print dialog."; } static getNumCopiesMin() { return 1; } static getPrintAreaDefault() { return "cropBox"; } static getPrintAreaDescription() { return "Selects the visible box, when displaying the document.\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 "cropBox"; } static getPrintClipDescription() { return "Selects the visible box, when displaying the document.\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 "Selects the page range, that shall initially be suggested for printing, when opening the Reader's print dialog. The page number can be an individual page, a page range, or a list (separated with commas) (e.g., \"1,5-6,9\"). To specify \"all pages,\" use an asterisk (\"\\*\")."; } static getPrintScalingDefault() { return "readerDefault"; } static getPrintScalingDescription() { return "The print scaling initially suggested when opening the Reader's print dialog.\n\n* readerDefault = The Reader shall use it's default suggestion.\n* byPDFSize = The Reader shall suggest to not scale the document during printing."; } static getPrintTraySelectionDefault() { return "readerDefault"; } static getPrintTraySelectionDescription() { return "The print tray selection initially suggested when opening the Reader's print dialog.\n\n* readerDefault = The Reader shall use it's default suggestion.\n* byPDFSize = The Reader shall select a print tray, that matches the PDF's page dimensions."; } static getTextDirectionDefault() { return "leftToRight"; } static getTextDirectionDescription() { return "Selects the predominant document's text writing\/reading direction.\n\n* leftToRight or\n* rightToLeft"; } static getViewAreaDefault() { return "cropBox"; } static getViewAreaDescription() { return "Selects the visible box, when displaying the document.\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 "cropBox"; } static getViewClipDescription() { return "Selects the visible box, when displaying the document.\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 MetadataViewerPreferences(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 MetadataViewerPreferences.fromJson(this.toJson()); } } exports.MetadataViewerPreferences = MetadataViewerPreferences; //# sourceMappingURL=MetadataViewerPreferences.js.map