UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

214 lines 12.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RubberStampAnnotation = void 0; const index_1 = require("./../index"); class RubberStampAnnotation { constructor(data) { let appearanceGenerationDefault = "nonStandard"; this.appearanceGeneration = typeof (data === null || data === void 0 ? void 0 : data.appearanceGeneration) !== "undefined" ? data === null || data === void 0 ? void 0 : data.appearanceGeneration : appearanceGenerationDefault; let colorDefault = "#4800FF"; this.color = typeof (data === null || data === void 0 ? void 0 : data.color) !== "undefined" ? data === null || data === void 0 ? void 0 : data.color : colorDefault; let contentsDefault = ""; this.contents = typeof (data === null || data === void 0 ? void 0 : data.contents) !== "undefined" ? data === null || data === void 0 ? void 0 : data.contents : contentsDefault; let creatorDefault = ""; this.creator = typeof (data === null || data === void 0 ? void 0 : data.creator) !== "undefined" ? data === null || data === void 0 ? void 0 : data.creator : creatorDefault; let customIconNameDefault = ""; this.customIconName = typeof (data === null || data === void 0 ? void 0 : data.customIconName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.customIconName : customIconNameDefault; let hiddenDefault = false; this.hidden = typeof (data === null || data === void 0 ? void 0 : data.hidden) !== "undefined" ? data === null || data === void 0 ? void 0 : data.hidden : hiddenDefault; let iconDefault = "draft"; this.icon = typeof (data === null || data === void 0 ? void 0 : data.icon) !== "undefined" ? data === null || data === void 0 ? void 0 : data.icon : iconDefault; let intentsDefault = ""; this.intents = typeof (data === null || data === void 0 ? void 0 : data.intents) !== "undefined" ? data === null || data === void 0 ? void 0 : data.intents : intentsDefault; let invisibleDefault = false; this.invisible = typeof (data === null || data === void 0 ? void 0 : data.invisible) !== "undefined" ? data === null || data === void 0 ? void 0 : data.invisible : invisibleDefault; let lockedDefault = true; this.locked = typeof (data === null || data === void 0 ? void 0 : data.locked) !== "undefined" ? data === null || data === void 0 ? void 0 : data.locked : lockedDefault; let nameDefault = ""; this.name = typeof (data === null || data === void 0 ? void 0 : data.name) !== "undefined" ? data === null || data === void 0 ? void 0 : data.name : nameDefault; this.normalAppearance = index_1.AppearanceSource.fromJson(data === null || data === void 0 ? void 0 : data.normalAppearance); let opacityDefault = 100; this.opacity = typeof (data === null || data === void 0 ? void 0 : data.opacity) !== "undefined" ? data === null || data === void 0 ? void 0 : data.opacity : opacityDefault; let pageDefault = 1; this.page = typeof (data === null || data === void 0 ? void 0 : data.page) !== "undefined" ? data === null || data === void 0 ? void 0 : data.page : pageDefault; this.position = index_1.PositionRubberStampAnnotation.fromJson(data === null || data === void 0 ? void 0 : data.position); let printableDefault = false; this.printable = typeof (data === null || data === void 0 ? void 0 : data.printable) !== "undefined" ? data === null || data === void 0 ? void 0 : data.printable : printableDefault; let rotatableDefault = true; this.rotatable = typeof (data === null || data === void 0 ? void 0 : data.rotatable) !== "undefined" ? data === null || data === void 0 ? void 0 : data.rotatable : rotatableDefault; let subjectDefault = ""; this.subject = typeof (data === null || data === void 0 ? void 0 : data.subject) !== "undefined" ? data === null || data === void 0 ? void 0 : data.subject : subjectDefault; let viewableDefault = true; this.viewable = typeof (data === null || data === void 0 ? void 0 : data.viewable) !== "undefined" ? data === null || data === void 0 ? void 0 : data.viewable : viewableDefault; let writableDefault = true; this.writable = typeof (data === null || data === void 0 ? void 0 : data.writable) !== "undefined" ? data === null || data === void 0 ? void 0 : data.writable : writableDefault; let zoomableDefault = true; this.zoomable = typeof (data === null || data === void 0 ? void 0 : data.zoomable) !== "undefined" ? data === null || data === void 0 ? void 0 : data.zoomable : zoomableDefault; } static getAppearanceGenerationDefault() { return "nonStandard"; } static getAppearanceGenerationDescription() { return "Determines for which named annotations appearance streams shall be generated.\n\n**Important:** Per definition some named annotations are defined as standard names and PDF readers shall provide the means to draw those.\n\n* always = An appearance stream shall be prepared for all created named annotations.\n* never = Don't provide appearance streams and rely on PDF readers to dynamically generate a proper representation of named annotations.\n* nonStandard = Only provide appearance streams for non-standard annotations."; } static getColorDefault() { return "#4800FF"; } static getColorDescription() { return "The annotation color will change the main color of visible annotations. The color needs to be specified as a hexadecimal RGB value with a number sign before it."; } static getContentsDefault() { return ""; } static getContentsDescription() { return "This value is used to configure the text content of the annotation, with the way in which it is displayed depending heavily on the specific annotation type (for example, in the case of a text note, this would be the text content of the annotation's popup)."; } static getCreatorDefault() { return ""; } static getCreatorDescription() { return "Used to specify the author of the annotation."; } static getCustomIconNameDefault() { return ""; } static getCustomIconNameDescription() { return "Sets a custom icon name for this annotation.\n\n**Important:** This name shall always take precedence over possibly set standard names. (icon)"; } static getHiddenDefault() { return false; } static getHiddenDescription() { return "If this value is set to true, the annotation will not be shown on the page and will not be printed either."; } static getIconDefault() { return "draft"; } static getIconDescription() { return "The known \"named\" icon types for rubberstamp annotations:\n\n* approved = A stamp that marks the stamped context as approved.\n* experimental = A stamp that marks the stamped content to be an experimental state.\n* notApproved = A stamp that disapproves the stamped context.\n* asIs = A stamp that marks the content as is.\n* expired = A stamp that marks the contained information as no longer valid.\n* notForPublicRelease = A stamp that marks something as information for internal use only.\n* confidential = A stamp marking the page as confidential.\n* final = A stamp that indicates, that the current state of the document is final.\n* sold = A stamp that indicates the marked contents to be sold and no longer available.\n* departmental = A stamp that forbids information to be shared to recipient outside of a given department.\n* forComment = Marks the stamped context as a comment.\n* topSecret = Marks the stamped content not to be shared publicly.\n* draft = A stamp marking the content to be a draft and therefore a work in progress.\n* forPublicRelease = Marks the content for public sharing.\n* unnamed = The rubberstamp shall not provide a predefined name."; } static getIntentsDefault() { return ""; } static getIntentsDescription() { return "Used to set the intention of the annotation.\n\n**Important:** The intention of an annotation can directly influence it's behaviour and may serve different purposes for different annotation types. Only set this directly, if you know it is necessary and possible to do so."; } static getInvisibleDefault() { return false; } static getInvisibleDescription() { return "If this value is set to true, the annotation will be visible on the page only when printed, and provided it is a PDF standard annotation."; } static getLockedDefault() { return true; } static getLockedDescription() { return "If this value is set to true, the annotation will be locked so that no changes can be made to it."; } static getNameDefault() { return ""; } static getNameDescription() { return "Used to specify the name of the annotation."; } static getNormalAppearanceDescription() { return ""; } static getOpacityDefault() { return 100; } static getOpacityDescription() { return "This percentage value is used to set the annotation's transparency."; } static getOpacityMin() { return 0; } static getOpacityMax() { return 100; } static getPageDefault() { return 1; } static getPageDescription() { return "Set the number of the page, the annotation shall be placed on."; } static getPageMin() { return 1; } static getPositionDescription() { return ""; } static getPrintableDefault() { return false; } static getPrintableDescription() { return "If this value is set to true, the annotation will be included when the page is printed out."; } static getRotatableDefault() { return true; } static getRotatableDescription() { return "If this value is set to true, the annotation shall be rotatable according to the displayed page rotation."; } static getSubjectDefault() { return ""; } static getSubjectDescription() { return "Used to specify the subject of the annotation."; } static getViewableDefault() { return true; } static getViewableDescription() { return "If this value is set to true, the annotation will be shown on the document's page."; } static getWritableDefault() { return true; } static getWritableDescription() { return "If this value is set to true, it will be possible to change the annotation's contents later on."; } static getZoomableDefault() { return true; } static getZoomableDescription() { return "If this value is set to true, the annotation will adjust its own zoom factor as required for the page in order to always be clearly readable \/ recognizable."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new RubberStampAnnotation(data); } toJson() { var _a, _b; return { 'appearanceGeneration': this.appearanceGeneration, 'color': this.color, 'contents': this.contents, 'creator': this.creator, 'customIconName': this.customIconName, 'hidden': this.hidden, 'icon': this.icon, 'intents': this.intents, 'invisible': this.invisible, 'locked': this.locked, 'name': this.name, 'normalAppearance': (_a = this.normalAppearance) === null || _a === void 0 ? void 0 : _a.toJson(), 'opacity': this.opacity, 'page': this.page, 'position': (_b = this.position) === null || _b === void 0 ? void 0 : _b.toJson(), 'printable': this.printable, 'rotatable': this.rotatable, 'subject': this.subject, 'viewable': this.viewable, 'writable': this.writable, 'zoomable': this.zoomable, }; } clone() { return RubberStampAnnotation.fromJson(this.toJson()); } } exports.RubberStampAnnotation = RubberStampAnnotation; //# sourceMappingURL=RubberStampAnnotation.js.map