UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

115 lines 6.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ToolboxPrintPrint = void 0; class ToolboxPrintPrint { constructor(data) { let autoRotateDefault = true; this.autoRotate = typeof (data === null || data === void 0 ? void 0 : data.autoRotate) !== "undefined" ? data === null || data === void 0 ? void 0 : data.autoRotate : autoRotateDefault; let centerInPageDefault = false; this.centerInPage = typeof (data === null || data === void 0 ? void 0 : data.centerInPage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.centerInPage : centerInPageDefault; let copiesDefault = 1; this.copies = typeof (data === null || data === void 0 ? void 0 : data.copies) !== "undefined" ? data === null || data === void 0 ? void 0 : data.copies : copiesDefault; let dpiDefault = 0; this.dpi = typeof (data === null || data === void 0 ? void 0 : data.dpi) !== "undefined" ? data === null || data === void 0 ? void 0 : data.dpi : dpiDefault; let expandToMarginsDefault = false; this.expandToMargins = typeof (data === null || data === void 0 ? void 0 : data.expandToMargins) !== "undefined" ? data === null || data === void 0 ? void 0 : data.expandToMargins : expandToMarginsDefault; let jobNameDefault = "webPDF Print Job"; this.jobName = typeof (data === null || data === void 0 ? void 0 : data.jobName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.jobName : jobNameDefault; let modeDefault = "default"; this.mode = typeof (data === null || data === void 0 ? void 0 : data.mode) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mode : modeDefault; 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 printerNameDefault = ""; this.printerName = typeof (data === null || data === void 0 ? void 0 : data.printerName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printerName : printerNameDefault; let shrinkToMarginsDefault = false; this.shrinkToMargins = typeof (data === null || data === void 0 ? void 0 : data.shrinkToMargins) !== "undefined" ? data === null || data === void 0 ? void 0 : data.shrinkToMargins : shrinkToMarginsDefault; } static getAutoRotateDefault() { return true; } static getAutoRotateDescription() { return "If \"true,\" the PDF document's orientation will be automatically adjusted in line with the printer's configured paper orientation."; } static getCenterInPageDefault() { return false; } static getCenterInPageDescription() { return "If \"true\", the PDF page will be centered in the middle of the paper."; } static getCopiesDefault() { return 1; } static getCopiesDescription() { return "Defines the number of copies that should be printed."; } static getCopiesMin() { return 1; } static getDpiDefault() { return 0; } static getDpiDescription() { return "Sets the printer resolution for the \"image\" print mode. If this value is set to 0, the document will be printed, using a resolution suggested by the printer. (High resolutions will lead to better quality results, but will tremendously increase the required time and resources.)"; } static getExpandToMarginsDefault() { return false; } static getExpandToMarginsDescription() { return "If \"true,\" any PDF page that is smaller than the paper will be enlarged to fit the paper size."; } static getJobNameDefault() { return "webPDF Print Job"; } static getJobNameDescription() { return "This attribute is used to define the name of the print job (as shown in the Print Spooler in Windows, for example)."; } static getModeDefault() { return "default"; } static getModeDescription() { return "Select the printing mode, that shall be used.\n\n* default = The drawing operations are applied to the printout as defined in the PDF document.\n* image = Creates an image of a fixed resolution for every page of the document, to guarantee a uniform printing result.\n* raster = Every page of the document is rastered before printing. This is a compatibility mode for older printers."; } static getPagesDefault() { return ""; } static getPagesDescription() { return "Defines which page(s) should be printed. 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 getPrinterNameDefault() { return ""; } static getPrinterNameDescription() { return "This attribute is used to specify the name of the printer that should be used to print the PDF document. If a printer is not declared, then the system's default printer will be used for printing."; } static getShrinkToMarginsDefault() { return false; } static getShrinkToMarginsDescription() { return "If \"true,\" any PDF page that is larger than the paper will be shrunk to fit the paper size."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new ToolboxPrintPrint(data); } toJson() { return { 'autoRotate': this.autoRotate, 'centerInPage': this.centerInPage, 'copies': this.copies, 'dpi': this.dpi, 'expandToMargins': this.expandToMargins, 'jobName': this.jobName, 'mode': this.mode, 'pages': this.pages, 'printerName': this.printerName, 'shrinkToMargins': this.shrinkToMargins, }; } clone() { return ToolboxPrintPrint.fromJson(this.toJson()); } } exports.ToolboxPrintPrint = ToolboxPrintPrint; //# sourceMappingURL=ToolboxPrintPrint.js.map