UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

67 lines 3.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtractionImages = void 0; class ExtractionImages { constructor(data) { let fallbackFormatDefault = "png"; this.fallbackFormat = typeof (data === null || data === void 0 ? void 0 : data.fallbackFormat) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fallbackFormat : fallbackFormatDefault; let fileFormatDefault = "zip"; this.fileFormat = typeof (data === null || data === void 0 ? void 0 : data.fileFormat) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileFormat : fileFormatDefault; let fileNameTemplateDefault = "file[%d]"; this.fileNameTemplate = typeof (data === null || data === void 0 ? void 0 : data.fileNameTemplate) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileNameTemplate : fileNameTemplateDefault; let folderNameTemplateDefault = "page[%d]"; this.folderNameTemplate = typeof (data === null || data === void 0 ? void 0 : data.folderNameTemplate) !== "undefined" ? data === null || data === void 0 ? void 0 : data.folderNameTemplate : folderNameTemplateDefault; 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; } static getFallbackFormatDefault() { return "png"; } static getFallbackFormatDescription() { return "Used to specify the format that should be used as the fallback format if extracting an image would result in a format that is not supported.\n\n* png = PNG file\n* jpeg = JPEG file"; } static getFileFormatDefault() { return "zip"; } static getFileFormatDescription() { return "Used to define the output format for the PDF document text contents being extracted.\n\n* text = Text document\n* xml = XML document\n* json = JSON data structure"; } static getFileNameTemplateDefault() { return "file[%d]"; } static getFileNameTemplateDescription() { return "Used to set the template for the image files in the returned ZIP file. \"file\\[%d\\]\", for example, would result in a \"file\\[1\\].png\" entry for a PNG image."; } static getFolderNameTemplateDefault() { return "page[%d]"; } static getFolderNameTemplateDescription() { return "Used to set the template for the page folders in the returned ZIP file. \"page\\[%d\\]\", for example, would result in a folder called \"page\\[1\\]\" for page 1, etc."; } static getPagesDefault() { return ""; } static getPagesDescription() { return "Used to define which page(s) should be used for the image's mode. The page number can be an individual page, a page range, or a list (separated with commas) (e.g., \"1,5-6,9\"). A blank value or \"\\*\" selects all pages of the PDF document."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new ExtractionImages(data); } toJson() { return { 'fallbackFormat': this.fallbackFormat, 'fileFormat': this.fileFormat, 'fileNameTemplate': this.fileNameTemplate, 'folderNameTemplate': this.folderNameTemplate, 'pages': this.pages, }; } clone() { return ExtractionImages.fromJson(this.toJson()); } } exports.ExtractionImages = ExtractionImages; //# sourceMappingURL=ExtractionImages.js.map