UNPKG

@syncfusion/ej2-pdfviewer

Version:
1,491 lines 340 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; import { Component, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex, isBlazor, Browser } from '@syncfusion/ej2-base'; import { isNullOrUndefined, Property, Event, SanitizeHtmlHelper } from '@syncfusion/ej2-base'; import { PdfViewerBase, PdfiumRunner } from './index'; import { PdfRenderer } from './index'; import { FontStyle, AnnotationResizerLocation, CursorType, ContextMenuItem, DynamicStampItem, SignStampItem, StandardBusinessStampItem, AnnotationDataFormat, DisplayMode, FormFieldDataFormat, ExtractTextOption } from './base/types'; import { FormFields } from './index'; import { PdfAnnotationBase, PdfFormFieldBase } from './drawing/pdf-annotation'; import { Drawing } from './drawing/drawing'; import { Selector } from './drawing/selector'; import { processPathData, splitArrayCollection } from '@syncfusion/ej2-drawings'; import { renderAdornerLayer } from './drawing/dom-util'; import { PdfViewerUtils, PdfiumTaskScheduler, TaskPriorityLevel } from './base/pdfviewer-utlis'; /** * The `ToolbarSettings` module is used to provide the toolbar settings of PDF viewer. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the tool bar settings. * viewer.toolbarSettings = { * showTooltip: false, * toolbarItems: [ * "OpenOption", * "UndoRedoTool", * "PageNavigationTool", * "MagnificationTool", * "PanTool", * "SelectionTool", * "CommentTool", * "SubmitForm", * "AnnotationEditTool", * "FormDesignerEditTool", * "FreeTextAnnotationOption", * "InkAnnotationOption", * "ShapeAnnotationOption", * "StampAnnotation", * "SignatureOption", * "SearchOption", * "PrintOption", * "DownloadOption" * ], * annotationToolbarItems: [ * "HighlightTool", * "UnderlineTool", * "StrikethroughTool", * "SquigglyTool", * "ColorEditTool", * "OpacityEditTool", * "AnnotationDeleteTool", * "StampAnnotationTool", * "HandWrittenSignatureTool", * "InkAnnotationTool", * "ShapeTool", * "CalibrateTool", * "StrokeColorEditTool", * "ThicknessEditTool", * "FreeTextAnnotationTool", * "FontFamilyAnnotationTool", * "FontSizeAnnotationTool", * "FontStylesAnnotationTool", * "FontAlignAnnotationTool", * "FontColorAnnotationTool", * "CommentPanelTool" * ], * formDesignerToolbarItems: [ * "TextboxTool", * "PasswordTool", * "CheckBoxTool", * "RadioButtonTool", * "DropdownTool", * "ListboxTool", * "DrawSignatureTool", * "DeleteTool" * ] * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var ToolbarSettings = /** @class */ (function (_super) { __extends(ToolbarSettings, _super); function ToolbarSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(true) ], ToolbarSettings.prototype, "showTooltip", void 0); __decorate([ Property() ], ToolbarSettings.prototype, "toolbarItems", void 0); __decorate([ Property() ], ToolbarSettings.prototype, "annotationToolbarItems", void 0); __decorate([ Property() ], ToolbarSettings.prototype, "formDesignerToolbarItems", void 0); return ToolbarSettings; }(ChildProperty)); export { ToolbarSettings }; /** * Defines customized toolbar items. */ var CustomToolbarItem = /** @class */ (function (_super) { __extends(CustomToolbarItem, _super); function CustomToolbarItem() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property('') ], CustomToolbarItem.prototype, "prefixIcon", void 0); __decorate([ Property('') ], CustomToolbarItem.prototype, "tooltipText", void 0); __decorate([ Property('') ], CustomToolbarItem.prototype, "id", void 0); __decorate([ Property('') ], CustomToolbarItem.prototype, "text", void 0); __decorate([ Property('') ], CustomToolbarItem.prototype, "cssClass", void 0); __decorate([ Property('left') ], CustomToolbarItem.prototype, "align", void 0); __decorate([ Property('') ], CustomToolbarItem.prototype, "template", void 0); __decorate([ Property('Button') ], CustomToolbarItem.prototype, "type", void 0); return CustomToolbarItem; }(ChildProperty)); export { CustomToolbarItem }; /** * The `AjaxRequestSettings` module is used to set the ajax Request Headers of PDF viewer. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // HTTP header "X-Custom-Header": "Custom header value" // Custom HTTP header * viewer.ajaxRequestSettings = { * ajaxHeaders: [ * { * headerName : "Authorization", * headerValue : "Bearer" * } * ], * withCredentials: false * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var AjaxRequestSettings = /** @class */ (function (_super) { __extends(AjaxRequestSettings, _super); function AjaxRequestSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property() ], AjaxRequestSettings.prototype, "ajaxHeaders", void 0); __decorate([ Property(false) ], AjaxRequestSettings.prototype, "withCredentials", void 0); return AjaxRequestSettings; }(ChildProperty)); export { AjaxRequestSettings }; /** * The `CustomStamp` module is used to provide the custom stamp added in stamp menu of the PDF Viewer toolbar. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Add your custom stamp image source as base64 image. * viewer.customStamp = [ * { * customStampName: 'Sample', * customStampImageSource: "data:image/png;base64, Syncfusion pdf viewer" * } * ]; * viewer.appendTo("#pdfViewer"); * ``` * */ var CustomStamp = /** @class */ (function (_super) { __extends(CustomStamp, _super); function CustomStamp() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property('') ], CustomStamp.prototype, "customStampName", void 0); __decorate([ Property('') ], CustomStamp.prototype, "customStampImageSource", void 0); return CustomStamp; }(ChildProperty)); export { CustomStamp }; /** * The `AnnotationToolbarSettings` module is used to provide the annotation toolbar settings of the PDF viewer. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the annotation tool bar settings. * viewer.toolbarSettings = { * showTooltip: false, * annotationToolbarItems: [ * "HighlightTool", * "UnderlineTool", * "StrikethroughTool", * "SquigglyTool", * "ColorEditTool", * "OpacityEditTool", * "AnnotationDeleteTool", * "StampAnnotationTool", * "HandWrittenSignatureTool", * "InkAnnotationTool", * "ShapeTool", * "CalibrateTool", * "StrokeColorEditTool", * "ThicknessEditTool", * "FreeTextAnnotationTool", * "FontFamilyAnnotationTool", * "FontSizeAnnotationTool", * "FontStylesAnnotationTool", * "FontAlignAnnotationTool", * "FontColorAnnotationTool", * "CommentPanelTool" * ], * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var AnnotationToolbarSettings = /** @class */ (function (_super) { __extends(AnnotationToolbarSettings, _super); function AnnotationToolbarSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(true) ], AnnotationToolbarSettings.prototype, "showTooltip", void 0); __decorate([ Property() ], AnnotationToolbarSettings.prototype, "annotationToolbarItem", void 0); return AnnotationToolbarSettings; }(ChildProperty)); export { AnnotationToolbarSettings }; /** * The `FormDesignerToolbarSettings` module is used to provide the Form designer toolbar settings of the PDF viewer. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the form field tool bar settings. * viewer.toolbarSettings = { * showTooltip: false, * formDesignerToolbarItems: [ * "TextboxTool", * "PasswordTool", * "CheckBoxTool", * "RadioButtonTool", * "DropdownTool", * "ListboxTool", * "DrawSignatureTool", * "DeleteTool" * ] * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var FormDesignerToolbarSettings = /** @class */ (function (_super) { __extends(FormDesignerToolbarSettings, _super); function FormDesignerToolbarSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(true) ], FormDesignerToolbarSettings.prototype, "showTooltip", void 0); __decorate([ Property() ], FormDesignerToolbarSettings.prototype, "formDesignerToolbarItem", void 0); return FormDesignerToolbarSettings; }(ChildProperty)); export { FormDesignerToolbarSettings }; /** * The `SignatureFieldSettings` module is used to set the properties of signature field in PDF Viewer * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the signature field settings. * viewer.signatureFieldSettings = { * bounds: {x:0, y:0, width:0, height:0}, * name: "", * isReadOnly: true, * visibility: "visible", * isRequired: true, * isPrint: false, * tooltip: "", * thickness: 1, * pageNumber: 0, * signatureIndicatorSettings: { * opacity: 1, * backgroundColor: "orange", * width: 19, * height: 10, * fontSize: 10, * text: null, * color: "black" * }, * signatureDialogSettings: { * displayMode: DisplayMode.Draw | DisplayMode.Text | DisplayMode.Upload, * hideSaveSignature: false * }, * customData: null, * typeSignatureFonts: ['arial'] * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var SignatureFieldSettings = /** @class */ (function (_super) { __extends(SignatureFieldSettings, _super); function SignatureFieldSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0, width: 0, height: 0 }) ], SignatureFieldSettings.prototype, "bounds", void 0); __decorate([ Property('') ], SignatureFieldSettings.prototype, "name", void 0); __decorate([ Property(false) ], SignatureFieldSettings.prototype, "isReadOnly", void 0); __decorate([ Property('visible') ], SignatureFieldSettings.prototype, "visibility", void 0); __decorate([ Property(false) ], SignatureFieldSettings.prototype, "isRequired", void 0); __decorate([ Property(false) ], SignatureFieldSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], SignatureFieldSettings.prototype, "tooltip", void 0); __decorate([ Property(1) ], SignatureFieldSettings.prototype, "thickness", void 0); __decorate([ Property(0) ], SignatureFieldSettings.prototype, "pageNumber", void 0); __decorate([ Property() ], SignatureFieldSettings.prototype, "signatureDialogSettings", void 0); __decorate([ Property() ], SignatureFieldSettings.prototype, "signatureIndicatorSettings", void 0); __decorate([ Property(null) ], SignatureFieldSettings.prototype, "customData", void 0); __decorate([ Property() ], SignatureFieldSettings.prototype, "typeSignatureFonts", void 0); return SignatureFieldSettings; }(ChildProperty)); export { SignatureFieldSettings }; /** * The `InitialFieldSettings` module is used to set the properties of initial field in PDF Viewer * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Changes the initial field settings. * viewer.initialFieldSettings = { * bounds: {x:0, y:0, width:0, height:0}, * name: "", * isReadOnly: true, * visibility: "visible", * isRequired: true, * isPrint: true, * tooltip: "", * thickness: 1, * pageNumber: 0, * isInitialField: false, * initialIndicatorSettings: { * opacity: 1, * backgroundColor: "orange", * width: 19, * height: 10, * fontSize: 10, * text: null, * color: "black" * }, * initialDialogSettings: { * displayMode: DisplayMode.Draw | DisplayMode.Text | DisplayMode.Upload, * hideSaveSignature: false * }, * customData: null, * typeInitialFonts: ['arial'] * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var InitialFieldSettings = /** @class */ (function (_super) { __extends(InitialFieldSettings, _super); function InitialFieldSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0, width: 0, height: 0 }) ], InitialFieldSettings.prototype, "bounds", void 0); __decorate([ Property('') ], InitialFieldSettings.prototype, "name", void 0); __decorate([ Property(false) ], InitialFieldSettings.prototype, "isReadOnly", void 0); __decorate([ Property('visible') ], InitialFieldSettings.prototype, "visibility", void 0); __decorate([ Property(false) ], InitialFieldSettings.prototype, "isRequired", void 0); __decorate([ Property(false) ], InitialFieldSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], InitialFieldSettings.prototype, "tooltip", void 0); __decorate([ Property(1) ], InitialFieldSettings.prototype, "thickness", void 0); __decorate([ Property(0) ], InitialFieldSettings.prototype, "pageNumber", void 0); __decorate([ Property(false) ], InitialFieldSettings.prototype, "isInitialField", void 0); __decorate([ Property() ], InitialFieldSettings.prototype, "initialDialogSettings", void 0); __decorate([ Property() ], InitialFieldSettings.prototype, "initialIndicatorSettings", void 0); __decorate([ Property(null) ], InitialFieldSettings.prototype, "customData", void 0); __decorate([ Property() ], InitialFieldSettings.prototype, "typeInitialFonts", void 0); return InitialFieldSettings; }(ChildProperty)); export { InitialFieldSettings }; /** * The `SignatureIndicatorSettings` module is used to provide the properties of signature Indicator in the signature field. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the signature indicator settings. * viewer.signatureFieldSettings = { * signatureIndicatorSettings: { * opacity: 1, * backgroundColor: 'orange', * width: 19, * height: 10, * fontSize: 10, * text: null, * color: 'black' * } * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var SignatureIndicatorSettings = /** @class */ (function (_super) { __extends(SignatureIndicatorSettings, _super); function SignatureIndicatorSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(1) ], SignatureIndicatorSettings.prototype, "opacity", void 0); __decorate([ Property('orange') ], SignatureIndicatorSettings.prototype, "backgroundColor", void 0); __decorate([ Property(19) ], SignatureIndicatorSettings.prototype, "width", void 0); __decorate([ Property(10) ], SignatureIndicatorSettings.prototype, "height", void 0); __decorate([ Property(10) ], SignatureIndicatorSettings.prototype, "fontSize", void 0); __decorate([ Property(null) ], SignatureIndicatorSettings.prototype, "text", void 0); __decorate([ Property('black') ], SignatureIndicatorSettings.prototype, "color", void 0); return SignatureIndicatorSettings; }(ChildProperty)); export { SignatureIndicatorSettings }; /** * The `SignatureDialogSettings` module is used to customize the signature dialog box. * * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the signature dialog settings. * viewer.signatureDialogSettings = { * displayMode: DisplayMode.Draw | DisplayMode.Text | DisplayMode.Upload, * hideSaveSignature: true * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var SignatureDialogSettings = /** @class */ (function (_super) { __extends(SignatureDialogSettings, _super); function SignatureDialogSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(DisplayMode.Draw | DisplayMode.Text | DisplayMode.Upload) ], SignatureDialogSettings.prototype, "displayMode", void 0); __decorate([ Property(false) ], SignatureDialogSettings.prototype, "hideSaveSignature", void 0); return SignatureDialogSettings; }(ChildProperty)); export { SignatureDialogSettings }; /** * The `ServerActionSettings` module is used to provide the server action methods of PDF viewer. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the server action settings. * viewer.serverActionSettings = { * load: "Load", * renderPages: "RenderPdfPages", * unload: "Unload", * download: "Download", * renderThumbnail: "RenderThumbnailImages", * print: "PrintImages", * renderComments: "RenderAnnotationComments", * importAnnotations: "ImportAnnotations", * exportAnnotations: "ExportAnnotations", * importFormFields: "ImportFormFields", * exportFormFields: "ExportFormFields", * renderTexts: "RenderPdfTexts", * validatePassword: "ValidatePassword" * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var ServerActionSettings = /** @class */ (function (_super) { __extends(ServerActionSettings, _super); function ServerActionSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property('Load') ], ServerActionSettings.prototype, "load", void 0); __decorate([ Property('Unload') ], ServerActionSettings.prototype, "unload", void 0); __decorate([ Property('RenderPdfPages') ], ServerActionSettings.prototype, "renderPages", void 0); __decorate([ Property('Print') ], ServerActionSettings.prototype, "print", void 0); __decorate([ Property('Download') ], ServerActionSettings.prototype, "download", void 0); __decorate([ Property('RenderThumbnailImages') ], ServerActionSettings.prototype, "renderThumbnail", void 0); __decorate([ Property('RenderAnnotationComments') ], ServerActionSettings.prototype, "renderComments", void 0); __decorate([ Property('ImportAnnotations') ], ServerActionSettings.prototype, "importAnnotations", void 0); __decorate([ Property('ExportAnnotations') ], ServerActionSettings.prototype, "exportAnnotations", void 0); __decorate([ Property('ImportFormFields') ], ServerActionSettings.prototype, "importFormFields", void 0); __decorate([ Property('ExportFormFields') ], ServerActionSettings.prototype, "exportFormFields", void 0); __decorate([ Property('RenderPdfTexts') ], ServerActionSettings.prototype, "renderTexts", void 0); __decorate([ Property('ValidatePassword') ], ServerActionSettings.prototype, "validatePassword", void 0); return ServerActionSettings; }(ChildProperty)); export { ServerActionSettings }; /** * The `StrikethroughSettings` module is used to provide the properties to Strikethrough annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the strike through annotation settings. * viewer.strikethroughSettings = { * pageNumber: 1, * bounds: [], * opacity: 1, * color: '#ff0000', * author: 'Guest', * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges * }, * customData: null, * isLock: false, * enableMultiPageAnnotation: false, * enableTextMarkupResizer: false, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var StrikethroughSettings = /** @class */ (function (_super) { __extends(StrikethroughSettings, _super); function StrikethroughSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(1) ], StrikethroughSettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], StrikethroughSettings.prototype, "opacity", void 0); __decorate([ Property('#ff0000') ], StrikethroughSettings.prototype, "color", void 0); __decorate([ Property('Guest') ], StrikethroughSettings.prototype, "author", void 0); __decorate([ Property('') ], StrikethroughSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(null) ], StrikethroughSettings.prototype, "customData", void 0); __decorate([ Property(false) ], StrikethroughSettings.prototype, "isLock", void 0); __decorate([ Property(false) ], StrikethroughSettings.prototype, "enableMultiPageAnnotation", void 0); __decorate([ Property(false) ], StrikethroughSettings.prototype, "enableTextMarkupResizer", void 0); __decorate([ Property(['None']) ], StrikethroughSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], StrikethroughSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], StrikethroughSettings.prototype, "subject", void 0); return StrikethroughSettings; }(ChildProperty)); export { StrikethroughSettings }; /** * The `SquigglySettings` module is used to provide the properties to Squiggly annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the squiggly annotation settings. * viewer.squigglySettings = { * pageNumber: 1, * bounds: [], * opacity: 1, * color: '#ff0000', * author: 'Guest', * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges * }, * customData: null, * isLock: false, * enableMultiPageAnnotation: false, * enableTextMarkupResizer: false, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var SquigglySettings = /** @class */ (function (_super) { __extends(SquigglySettings, _super); function SquigglySettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(1) ], SquigglySettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], SquigglySettings.prototype, "opacity", void 0); __decorate([ Property('#ff0000') ], SquigglySettings.prototype, "color", void 0); __decorate([ Property('Guest') ], SquigglySettings.prototype, "author", void 0); __decorate([ Property('') ], SquigglySettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(null) ], SquigglySettings.prototype, "customData", void 0); __decorate([ Property(false) ], SquigglySettings.prototype, "isLock", void 0); __decorate([ Property(false) ], SquigglySettings.prototype, "enableMultiPageAnnotation", void 0); __decorate([ Property(false) ], SquigglySettings.prototype, "enableTextMarkupResizer", void 0); __decorate([ Property(['None']) ], SquigglySettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], SquigglySettings.prototype, "isPrint", void 0); __decorate([ Property('') ], SquigglySettings.prototype, "subject", void 0); return SquigglySettings; }(ChildProperty)); export { SquigglySettings }; /** * The `UnderlineSettings` module is used to provide the properties to Underline annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the underline annotation settings. * viewer.underlineSettings = { * pageNumber: 1, * bounds: [], * opacity: 1, * color: '#9c2592', * author: 'Guest', * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges * }, * customData: null, * isLock: false, * enableMultiPageAnnotation: false, * enableTextMarkupResizer: false, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var UnderlineSettings = /** @class */ (function (_super) { __extends(UnderlineSettings, _super); function UnderlineSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(1) ], UnderlineSettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], UnderlineSettings.prototype, "opacity", void 0); __decorate([ Property('#00ff00') ], UnderlineSettings.prototype, "color", void 0); __decorate([ Property('Guest') ], UnderlineSettings.prototype, "author", void 0); __decorate([ Property('') ], UnderlineSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(null) ], UnderlineSettings.prototype, "customData", void 0); __decorate([ Property(false) ], UnderlineSettings.prototype, "isLock", void 0); __decorate([ Property(false) ], UnderlineSettings.prototype, "enableMultiPageAnnotation", void 0); __decorate([ Property(false) ], UnderlineSettings.prototype, "enableTextMarkupResizer", void 0); __decorate([ Property(['None']) ], UnderlineSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], UnderlineSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], UnderlineSettings.prototype, "subject", void 0); return UnderlineSettings; }(ChildProperty)); export { UnderlineSettings }; /** * The `HighlightSettings` module is used to provide the properties to Highlight annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the highlight annotation settings. * viewer.highlightSettings = { * pageNumber: 1, * bounds: [], * opacity: 1, * color: '#ff0000', * author: 'Guest', * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges * }, * customData: null, * isLock: false, * enableMultiPageAnnotation: false, * enableTextMarkupResizer: false, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var HighlightSettings = /** @class */ (function (_super) { __extends(HighlightSettings, _super); function HighlightSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(1) ], HighlightSettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], HighlightSettings.prototype, "opacity", void 0); __decorate([ Property('#FFDF56') ], HighlightSettings.prototype, "color", void 0); __decorate([ Property('Guest') ], HighlightSettings.prototype, "author", void 0); __decorate([ Property('') ], HighlightSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(null) ], HighlightSettings.prototype, "customData", void 0); __decorate([ Property(false) ], HighlightSettings.prototype, "isLock", void 0); __decorate([ Property(false) ], HighlightSettings.prototype, "enableMultiPageAnnotation", void 0); __decorate([ Property(false) ], HighlightSettings.prototype, "enableTextMarkupResizer", void 0); __decorate([ Property(['None']) ], HighlightSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], HighlightSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], HighlightSettings.prototype, "subject", void 0); return HighlightSettings; }(ChildProperty)); export { HighlightSettings }; /** * The `LineSettings` module is used to provide the properties to line annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the line annotation settings. * viewer.lineSettings = { * offset: { x:0, y:0 }, * pageNumber: 1, * vertexPoints: [], * opacity: 1, * fillColor: 'ffffff00', * strokeColor: '#ff0000', * author: 'Guest', * thickness: 1, * lineHeadStartStyle: 'None', * lineHeadEndStyle: 'None', * borderDashArray: 0, * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges * }, * minHeight: 0, * minWidth: 0, * maxHeight: 0, * maxWidth: 0, * isLock: false, * customData: null, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var LineSettings = /** @class */ (function (_super) { __extends(LineSettings, _super); function LineSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0 }) ], LineSettings.prototype, "offset", void 0); __decorate([ Property(1) ], LineSettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], LineSettings.prototype, "opacity", void 0); __decorate([ Property('#ffffff00') ], LineSettings.prototype, "fillColor", void 0); __decorate([ Property('#ff0000') ], LineSettings.prototype, "strokeColor", void 0); __decorate([ Property('Guest') ], LineSettings.prototype, "author", void 0); __decorate([ Property('1') ], LineSettings.prototype, "thickness", void 0); __decorate([ Property('None') ], LineSettings.prototype, "lineHeadStartStyle", void 0); __decorate([ Property('None') ], LineSettings.prototype, "lineHeadEndStyle", void 0); __decorate([ Property(0) ], LineSettings.prototype, "borderDashArray", void 0); __decorate([ Property('') ], LineSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(0) ], LineSettings.prototype, "minHeight", void 0); __decorate([ Property(0) ], LineSettings.prototype, "minWidth", void 0); __decorate([ Property(0) ], LineSettings.prototype, "maxHeight", void 0); __decorate([ Property(0) ], LineSettings.prototype, "maxWidth", void 0); __decorate([ Property(false) ], LineSettings.prototype, "isLock", void 0); __decorate([ Property(null) ], LineSettings.prototype, "customData", void 0); __decorate([ Property(['None']) ], LineSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], LineSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], LineSettings.prototype, "subject", void 0); return LineSettings; }(ChildProperty)); export { LineSettings }; /** * Options for configuring line type annotation drawing behavior. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * viewer.annotationDrawingOptions = { * enableLineAngleConstraints: true, * restrictLineAngleTo: 90 * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var AnnotationDrawingOptions = /** @class */ (function (_super) { __extends(AnnotationDrawingOptions, _super); function AnnotationDrawingOptions() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property(false) ], AnnotationDrawingOptions.prototype, "enableLineAngleConstraints", void 0); __decorate([ Property(45) ], AnnotationDrawingOptions.prototype, "restrictLineAngleTo", void 0); return AnnotationDrawingOptions; }(ChildProperty)); export { AnnotationDrawingOptions }; /** * The `ArrowSettings` module is used to provide the properties to arrow annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the arrow annotation settings. * viewer.arrowSettings = { * offset: { x:0, y:0 }, * pageNumber: 1, * vertexPoints: [], * opacity: 1, * fillColor: '#9c2592', * strokeColor: '#ff0000', * author: 'Guest', * thickness: 1, * borderDashArray: 0, * lineHeadStartStyle: 'Closed', * lineHeadEndStyle: 'Closed', * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges, * resizerCursorType: null * }, * minHeight: 0, * minWidth: 0, * maxWidth: 0, * maxHeight: 0, * isLock: false, * customData: null, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var ArrowSettings = /** @class */ (function (_super) { __extends(ArrowSettings, _super); function ArrowSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0 }) ], ArrowSettings.prototype, "offset", void 0); __decorate([ Property(1) ], ArrowSettings.prototype, "pageNumber", void 0); __decorate([ Property(1) ], ArrowSettings.prototype, "opacity", void 0); __decorate([ Property('#ffffff00') ], ArrowSettings.prototype, "fillColor", void 0); __decorate([ Property('#ff0000') ], ArrowSettings.prototype, "strokeColor", void 0); __decorate([ Property('Guest') ], ArrowSettings.prototype, "author", void 0); __decorate([ Property('1') ], ArrowSettings.prototype, "thickness", void 0); __decorate([ Property('None') ], ArrowSettings.prototype, "lineHeadStartStyle", void 0); __decorate([ Property('None') ], ArrowSettings.prototype, "lineHeadEndStyle", void 0); __decorate([ Property(0) ], ArrowSettings.prototype, "borderDashArray", void 0); __decorate([ Property('') ], ArrowSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(0) ], ArrowSettings.prototype, "minHeight", void 0); __decorate([ Property(0) ], ArrowSettings.prototype, "minWidth", void 0); __decorate([ Property(0) ], ArrowSettings.prototype, "maxHeight", void 0); __decorate([ Property(0) ], ArrowSettings.prototype, "maxWidth", void 0); __decorate([ Property(false) ], ArrowSettings.prototype, "isLock", void 0); __decorate([ Property(null) ], ArrowSettings.prototype, "customData", void 0); __decorate([ Property(['None']) ], ArrowSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], ArrowSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], ArrowSettings.prototype, "subject", void 0); return ArrowSettings; }(ChildProperty)); export { ArrowSettings }; /** * The `RectangleSettings` module is used to provide the properties to rectangle annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the rectangle annotation settings. * viewer.rectangleSettings = { * offset: { x:0, y:0 }, * pageNumber: 1, * width: 100, * height: 50, * opacity: 1, * fillColor: '#9c2592', * strokeColor: '#ff0000', * author: 'Guest', * thickness: 1, * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges, * resizerCursorType: null * }, * minHeight: 0, * minWidth: 0, * maxWidth: 0, * maxHeight: 0, * isLock: false, * customData: null, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var RectangleSettings = /** @class */ (function (_super) { __extends(RectangleSettings, _super); function RectangleSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0 }) ], RectangleSettings.prototype, "offset", void 0); __decorate([ Property(1) ], RectangleSettings.prototype, "pageNumber", void 0); __decorate([ Property(100) ], RectangleSettings.prototype, "width", void 0); __decorate([ Property(50) ], RectangleSettings.prototype, "height", void 0); __decorate([ Property(1) ], RectangleSettings.prototype, "opacity", void 0); __decorate([ Property('#ffffff00') ], RectangleSettings.prototype, "fillColor", void 0); __decorate([ Property('#ff0000') ], RectangleSettings.prototype, "strokeColor", void 0); __decorate([ Property('Guest') ], RectangleSettings.prototype, "author", void 0); __decorate([ Property('1') ], RectangleSettings.prototype, "thickness", void 0); __decorate([ Property('') ], RectangleSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(0) ], RectangleSettings.prototype, "minHeight", void 0); __decorate([ Property(0) ], RectangleSettings.prototype, "minWidth", void 0); __decorate([ Property(0) ], RectangleSettings.prototype, "maxHeight", void 0); __decorate([ Property(0) ], RectangleSettings.prototype, "maxWidth", void 0); __decorate([ Property(false) ], RectangleSettings.prototype, "isLock", void 0); __decorate([ Property(null) ], RectangleSettings.prototype, "customData", void 0); __decorate([ Property(['None']) ], RectangleSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], RectangleSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], RectangleSettings.prototype, "subject", void 0); return RectangleSettings; }(ChildProperty)); export { RectangleSettings }; /** * The `CircleSettings` module is used to provide the properties to circle annotation. * * ```html * <div id="pdfViewer" style="height: 100%;width: 100%;"></div> * ``` * ```ts * let viewer: PdfViewer = new PdfViewer(); * // Change the circle annotation settings. * viewer.circleSettings = { * offset: { x:0, y:0 }, * pageNumber: 1, * width: 100, * height: 100, * opacity: 1, * fillColor: '#9c2592', * strokeColor: '#ff0000', * author: 'Guest', * thickness: 1, * annotationSelectorSettings: { * selectionBorderColor: '', * resizerBorderColor: 'black', * resizerFillColor: '#FF4081', * resizerSize: 8, * selectionBorderThickness: 1, * resizerShape: 'Square', * selectorLineDashArray: [], * resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges, * resizerCursorType: null * }, * minHeight: 0, * minWidth: 0, * maxWidth: 0, * maxHeight: 0, * isLock: false, * customData: null, * allowedInteractions: ['None'], * isPrint: true, * subject: '' * }; * viewer.appendTo("#pdfViewer"); * ``` * */ var CircleSettings = /** @class */ (function (_super) { __extends(CircleSettings, _super); function CircleSettings() { return _super !== null && _super.apply(this, arguments) || this; } __decorate([ Property({ x: 0, y: 0 }) ], CircleSettings.prototype, "offset", void 0); __decorate([ Property(1) ], CircleSettings.prototype, "pageNumber", void 0); __decorate([ Property(100) ], CircleSettings.prototype, "width", void 0); __decorate([ Property(100) ], CircleSettings.prototype, "height", void 0); __decorate([ Property(1) ], CircleSettings.prototype, "opacity", void 0); __decorate([ Property('#ffffff00') ], CircleSettings.prototype, "fillColor", void 0); __decorate([ Property('#ff0000') ], CircleSettings.prototype, "strokeColor", void 0); __decorate([ Property('Guest') ], CircleSettings.prototype, "author", void 0); __decorate([ Property('1') ], CircleSettings.prototype, "thickness", void 0); __decorate([ Property('') ], CircleSettings.prototype, "annotationSelectorSettings", void 0); __decorate([ Property(0) ], CircleSettings.prototype, "minHeight", void 0); __decorate([ Property(0) ], CircleSettings.prototype, "minWidth", void 0); __decorate([ Property(0) ], CircleSettings.prototype, "maxHeight", void 0); __decorate([ Property(0) ], CircleSettings.prototype, "maxWidth", void 0); __decorate([ Property(false) ], CircleSettings.prototype, "isLock", void 0); __decorate([ Property(null) ], CircleSettings.prototype, "customData", void 0); __decorate([ Property(['None']) ], CircleSettings.prototype, "allowedInteractions", void 0); __decorate([ Property(true) ], CircleSettings.prototype, "isPrint", void 0); __decorate([ Property('') ], CircleSettings.prototype, "subject", void 0); return CircleSettings; }(ChildProperty)); export { CircleSettings }; /** * The `ShapeLabelSettings` module is used to provide the properties to rectangle annotation. * * ```htm