@syncfusion/ej2-pdfviewer
Version:
Essential JS 2 PDF viewer Component
2,075 lines (1,661 loc) • 142 kB
TypeScript
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex, isBlazor, Browser } from '@syncfusion/ej2-base';import { ModuleDeclaration, isNullOrUndefined, Property, Event, EmitType, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { IAnnotationPoint, IPoint, IPageAnnotations, PdfViewerBase, PdfiumRunner, TextMarkupAnnotation, ShapeAnnotation, MeasureAnnotation, OrganizeDetails } from './index';import { Navigation } from './index';import { Magnification } from './index';import { Toolbar } from './index';import { AnnotationToolbar } from './index';import { RedactionToolbar } from './toolbar/redaction-toolbar';import { FormDesignerToolbar } from './toolbar/formdesigner-toolbar';import { PdfRenderedFields } from './pdf-base/form-fields-base';import { ToolbarItem } from './index';import { PdfRenderer } from './index';import { LinkTarget, InteractionMode, SignatureFitMode, AnnotationType, AnnotationToolbarItem, RedactionToolbarItem, LineHeadStyle, ContextMenuAction, FontStyle, TextAlignment, AnnotationResizerShape, AnnotationResizerLocation, ZoomMode, PrintMode, CursorType, ContextMenuItem, DynamicStampItem, SignStampItem, StandardBusinessStampItem, FormFieldType, AllowedInteraction, AnnotationDataFormat, SignatureType, CommentStatus, SignatureItem, FormDesignerToolbarItem, DisplayMode, Visibility, FormFieldDataFormat, PdfKeys, ModifierKeys, ExtractTextOption } from './base/types';import { Annotation } from './index';import { LinkAnnotation } from './index';import { ThumbnailView } from './index';import { BookmarkView } from './index';import { TextSelection } from './index';import { TextSearch } from './index';import { AccessibilityTags } from './index';import { FormFields } from './index';import { FormDesigner } from './index';import { Print, CalibrationUnit } from './index';import { PageOrganizer } from './index';import { UnloadEventArgs, LoadEventArgs, LoadFailedEventArgs, AjaxRequestFailureEventArgs, PageChangeEventArgs, PageClickEventArgs, ZoomChangeEventArgs, HyperlinkClickEventArgs, HyperlinkMouseOverArgs, ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, ExportFailureEventArgs, AjaxRequestInitiateEventArgs, PageRenderInitiateEventArgs, AjaxRequestSuccessEventArgs, PageRenderCompleteEventArgs, PageOrganizerSaveAsEventArgs, PageOrganizerZoomChangedEventArgs } from './index';import { AnnotationAddEventArgs, AnnotationRemoveEventArgs, AnnotationPropertiesChangeEventArgs, AnnotationResizeEventArgs, AnnotationSelectEventArgs, AnnotationMoveEventArgs, AnnotationDoubleClickEventArgs, AnnotationMouseoverEventArgs, PageMouseoverEventArgs, AnnotationMouseLeaveEventArgs , ButtonFieldClickEventArgs} from './index';import { TextSelectionStartEventArgs, TextSelectionEndEventArgs, DownloadStartEventArgs, DownloadEndEventArgs, ExtractTextCompletedEventArgs, PrintStartEventArgs, PrintEndEventArgs } from './index';import { TextSearchStartEventArgs, TextSearchCompleteEventArgs, TextSearchHighlightEventArgs } from './index';import { CustomContextMenuSelectEventArgs, CustomContextMenuBeforeOpenEventArgs } from './index';import { PdfAnnotationBase, PdfFormFieldBase, ZOrderPageTable } from './drawing/pdf-annotation';import { PdfAnnotationBaseModel, PdfFormFieldBaseModel } from './drawing/pdf-annotation-model';import { Drawing, ClipBoardObject } from './drawing/drawing';import { Selector } from './drawing/selector';import { SelectorModel } from './drawing/selector-model';import { PointModel, IElement, Rect, Point, Size, processPathData, splitArrayCollection, getPathString } from '@syncfusion/ej2-drawings';import { renderAdornerLayer } from './drawing/dom-util';import { ThumbnailClickEventArgs } from './index';import { ValidateFormFieldsArgs, BookmarkClickEventArgs, AnnotationUnSelectEventArgs, BeforeAddFreeTextEventArgs, FormFieldFocusOutEventArgs, CommentEventArgs, FormFieldClickArgs, FormFieldAddArgs, FormFieldRemoveArgs, FormFieldPropertiesChangeArgs, FormFieldMouseLeaveArgs, FormFieldMouseoverArgs, FormFieldMoveArgs, FormFieldResizeArgs, FormFieldSelectArgs, FormFieldUnselectArgs, FormFieldDoubleClickArgs, AnnotationMovingEventArgs, KeyboardCustomCommandsEventArgs, ISize } from './base';import { AddSignatureEventArgs, RemoveSignatureEventArgs, MoveSignatureEventArgs, SignaturePropertiesChangeEventArgs, ResizeSignatureEventArgs, SignatureSelectEventArgs, SignatureUnselectEventArgs } from './base';import { IFormField, IFormFieldBound } from './form-designer/form-designer';import { ClickEventArgs, MenuItemModel } from '@syncfusion/ej2-navigations';import { PdfViewerUtils, PdfiumTaskScheduler, TaskPriorityLevel } from './base/pdfviewer-utlis';import { Rectangle } from '@syncfusion/ej2-pdf';import { PdfDocument, PdfPageImportOptions } from '@syncfusion/ej2-pdf';
import {IAjaxHeaders,IPdfRectBounds} from "./pdfviewer";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class ToolbarSettings
*/
export interface ToolbarSettingsModel {
/**
* Enable or disables the tooltip of the toolbars.
*/
showTooltip?: boolean;
/**
* shows only the defined options in the PdfViewer.
*/
toolbarItems?: (CustomToolbarItemModel | ToolbarItem)[];
/**
* Provide option to customize the annotation toolbar of the PDF Viewer.
*/
annotationToolbarItems?: AnnotationToolbarItem[];
/**
* Provide option to customize the redaction toolbar of the PDF Viewer.
* This redaction customization feature shall be available only when the PDF Viewer is operating in Standalone Mode.
*/
redactionToolbarItems?: RedactionToolbarItem[];
/**
* Customize the tools to be exposed in the form designer toolbar.
*/
formDesignerToolbarItems?: FormDesignerToolbarItem[];
}
/**
* Interface for a class CustomToolbarItem
*/
export interface CustomToolbarItemModel {
/**
* Defines single/multiple classes separated by space used to specify an icon for the button.
* The icon will be positioned before the text content if text is available, otherwise the icon alone will be rendered.
*/
prefixIcon?: string;
/**
* Specifies the text to be displayed on the Toolbar button.
*/
tooltipText?: string;
/**
* Specifies the unique ID to be used with button or input element of Toolbar items.
*/
id?: string;
/**
* Specifies the text to be displayed on the Toolbar button.
*/
text?: string;
/**
* Defines single/multiple classes (separated by space) to be used for customization of commands.
*/
cssClass?: string;
/**
* Define which side(right/left) to use for customizing the icon.
*/
align?: string;
/**
* Specifies the HTML element/element ID as a string that can be added as a Toolbar command.
*/
template?: string | object | Function;
/**
* Specify the type or category of the Toolbar item.
*/
type?: string;
}
/**
* Interface for a class AjaxRequestSettings
*/
export interface AjaxRequestSettingsModel {
/**
* set the ajax Header values in the PdfViewer.
*/
ajaxHeaders?: IAjaxHeaders[];
/**
* set the ajax credentials for the pdfviewer.
*/
withCredentials?: boolean;
}
/**
* Interface for a class CustomStamp
*/
export interface CustomStampModel {
/**
* Defines the custom stamp name to be added in stamp menu of the PDF Viewer toolbar.
*/
customStampName?: string;
/**
* Defines the custom stamp images source to be added in stamp menu of the PDF Viewer toolbar.
*/
customStampImageSource?: string;
}
/**
* Interface for a class AnnotationToolbarSettings
*/
export interface AnnotationToolbarSettingsModel {
/**
* Enable or disables the tooltip of the toolbar.
*/
showTooltip?: boolean;
/**
* shows only the defined options in the PdfViewer.
*/
annotationToolbarItem?: AnnotationToolbarItem[];
}
/**
* Interface for a class FormDesignerToolbarSettings
*/
export interface FormDesignerToolbarSettingsModel {
/**
* Enable or disables the tooltip of the toolbar.
*/
showTooltip?: boolean;
/**
* shows only the defined options in the PdfViewer.
*/
formDesignerToolbarItem?: FormDesignerToolbarItem[];
}
/**
* Interface for a class RedactionToolbarSettings
*/
export interface RedactionToolbarSettingsModel {
/**
* Enable or disables the tooltip of the toolbar.
*/
showTooltip?: boolean;
/**
* Gets or sets the toolbar items available in the redaction toolbar of the PDF Viewer.
*/
redactionToolbarItem?: RedactionToolbarItem[];
}
/**
* Interface for a class SignatureFieldSettings
*/
export interface SignatureFieldSettingsModel {
/**
* Get or set the form field bounds.
*/
bounds?: IFormFieldBound;
/**
* Get or set the name of the form field element.
*/
name?: string;
/**
* Specifies whether the signature field is in read-only or read-write mode. FALSE by default.
*/
isReadOnly?: boolean;
/**
* Gets or set the visibility of the form field.
*/
visibility?: Visibility;
/**
* If it is set as true, consider as mandatory field in the PDF document. By default it is false.
*/
isRequired?: boolean;
/**
* Get or set the boolean value to print the signature field. TRUE by default.
*/
isPrint?: boolean;
/**
* Get or set the text to be displayed as tooltip. By default it is empty.
*/
tooltip?: string;
/**
* Get or set the thickness of the Signature field. Default value is 1. To hide the borders, set the value to 0 (zero).
*/
thickness?: number;
/**
* specifies the page number of the form field.
*/
pageNumber?: number;
/**
* Specifies the properties of the signature Dialog Settings in the signature field.
*/
signatureDialogSettings?: SignatureDialogSettingsModel;
/**
* Specifies the properties of the signature indicator in the signature field.
*/
signatureIndicatorSettings?: SignatureIndicatorSettingsModel;
/**
* specifies the custom data of the form fields.
*/
customData?: object;
/**
* Allows setting the font name for typed signatures at specific indices. The maximum number of font names is limited to 4, so the key values should range from 0 to 3.
*/
typeSignatureFonts?: { [key: number]: string };
}
/**
* Interface for a class InitialFieldSettings
*/
export interface InitialFieldSettingsModel {
/**
* Get or set the form field bounds.
*/
bounds?: IFormFieldBound;
/**
* Get or set the name of the form field element.
*/
name?: string;
/**
* Specifies whether the initial field is in read-only or read-write mode. FALSE by default.
*/
isReadOnly?: boolean;
/**
* Gets or set the visibility of the form field.
*/
visibility?: Visibility;
/**
* If it is set as true, consider as mandatory field in the PDF document. By default it is false.
*/
isRequired?: boolean;
/**
* Get or set the boolean value to print the initial field. TRUE by default.
*/
isPrint?: boolean;
/**
* Get or set the text to be displayed as tooltip. By default it is empty.
*/
tooltip?: string;
/**
* Get or set the thickness of the Initial field. Default value is 1. To hide the borders, set the value to 0 (zero).
*/
thickness?: number;
/**
* specifies the page number of the form field.
*/
pageNumber?: number;
/**
* Gets or sets the initial field type of the signature field.
*/
isInitialField?: boolean;
/**
* Get or set the signature dialog settings for initial field.
*/
initialDialogSettings?: SignatureDialogSettingsModel;
/**
* Specifies the properties of the signature indicator in the initial field.
*/
initialIndicatorSettings?: SignatureIndicatorSettingsModel;
/**
* specifies the custom data of the form fields.
*/
customData?: object;
/**
* Allows setting the font name for typed initials at specific indices. The maximum number of font names is limited to 4, so the key values should range from 0 to 3.
*/
typeInitialFonts?: { [key: number]: string };
}
/**
* Interface for a class SignatureIndicatorSettings
*/
export interface SignatureIndicatorSettingsModel {
/**
* Specifies the opacity of the signature indicator.
*/
opacity?: number;
/**
* Specifies the color of the signature indicator.
*/
backgroundColor?: string;
/**
* Specifies the width of the signature indicator. Maximum width is half the width of the signature field.
* Minimum width is the default value.
*/
width?: number;
/**
* Specifies the height of the signature indicator. Maximum height is half the height of the signature field.
* Minimum height is the default value.
*/
height?: number;
/**
* Specifies the signature Indicator's font size. The maximum size of the font is half the height of the signature field.
*/
fontSize?: number;
/**
* Specifies the text of the signature Indicator.
*/
text?: string;
/**
* Specifies the color of the text of signature indicator.
*/
color?: string;
}
/**
* Interface for a class SignatureDialogSettings
*/
export interface SignatureDialogSettingsModel {
/**
* Get or set the required signature options will be enabled in the signature dialog.
*/
displayMode?: DisplayMode;
/**
* Get or set a boolean value to show or hide the save signature check box option in the signature dialog. FALSE by default.
*/
hideSaveSignature?: boolean;
}
/**
* Interface for a class ServerActionSettings
*/
export interface ServerActionSettingsModel {
/**
* specifies the load action of PdfViewer.
*/
load?: string;
/**
* specifies the unload action of PdfViewer.
*/
unload?: string;
/**
* specifies the render action of PdfViewer.
*/
renderPages?: string;
/**
* specifies the print action of PdfViewer.
*/
print?: string;
/**
* specifies the download action of PdfViewer.
*/
download?: string;
/**
* specifies the render thumbnail action of PdfViewer.
*/
renderThumbnail?: string;
/**
* specifies the annotation comments action of PdfViewer.
*/
renderComments?: string;
/**
* specifies the imports annotations action of PdfViewer.
*/
importAnnotations?: string;
/**
* specifies the export annotations action of PdfViewer.
*/
exportAnnotations?: string;
/**
* specifies the imports form fields action of PdfViewer.
*/
importFormFields?: string;
/**
* specifies the export form fields action of PdfViewer.
*/
exportFormFields?: string;
/**
* specifies the render pdf texts action of PdfViewer.
*/
renderTexts?: string;
/**
* Specifies the password validation action of PDF Viewer.
*/
validatePassword?: string;
}
/**
* Interface for a class StrikethroughSettings
*/
export interface StrikethroughSettingsModel {
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the color of the annotation.
*/
color?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* Enables or disables the multi-page text markup annotation selection in UI.
*
* @default false
*/
enableMultiPageAnnotation?: boolean;
/**
* Enable or disable the text markup resizer to modify the bounds in UI.
*
* @default false
*/
enableTextMarkupResizer?: boolean;
/**
* Gets or sets the allowed interactions for the locked strikethrough annotations.
* IsLock can be configured using strikethrough settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class SquigglySettings
*/
export interface SquigglySettingsModel {
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the color of the annotation.
*/
color?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* Enables or disables the multi-page text markup annotation selection in UI.
*
* @default false
*/
enableMultiPageAnnotation?: boolean;
/**
* Enable or disable the text markup resizer to modify the bounds in UI.
*
* @default false
*/
enableTextMarkupResizer?: boolean;
/**
* Gets or sets the allowed interactions for the locked squiggly annotations.
* IsLock can be configured using squiggly settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class UnderlineSettings
*/
export interface UnderlineSettingsModel {
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the color of the annotation.
*/
color?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* Enables or disables the multi-page text markup annotation selection in UI.
*
* @default false
*/
enableMultiPageAnnotation?: boolean;
/**
* Enable or disable the text markup resizer to modify the bounds in UI.
*
* @default false
*/
enableTextMarkupResizer?: boolean;
/**
* Gets or sets the allowed interactions for the locked underline annotations.
* IsLock can be configured using underline settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class HighlightSettings
*/
export interface HighlightSettingsModel {
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the color of the annotation.
*/
color?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* Enables or disables the multi-page text markup annotation selection in UI.
*
* @default false
*/
enableMultiPageAnnotation?: boolean;
/**
* Enable or disable the text markup resizer to modify the bounds in UI.
*
* @default false
*/
enableTextMarkupResizer?: boolean;
/**
* Gets or sets the allowed interactions for the locked highlight annotations.
* IsLock can be configured using highlight settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class LineSettings
*/
export interface LineSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the line head start style of the annotation.
*/
lineHeadStartStyle?: LineHeadStyle;
/**
* specifies the line head end style of the annotation.
*/
lineHeadEndStyle?: LineHeadStyle;
/**
* specifies the border dash array of the annotation.
*/
borderDashArray?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked line annotations.
* IsLock can be configured using line settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class AnnotationDrawingOptions
*/
export interface AnnotationDrawingOptionsModel {
/**
* Enables angular constraints for line-type annotations.
*
* When set to `true`, lines and arrows are restricted to fixed angles defined by the `restrictLineAngleTo` property.
* On desktop platforms, holding the **Shift** key while drawing also activates angle constraints,
* allowing precise control over line orientation.
*/
enableLineAngleConstraints?: boolean;
/**
* Specifies the angle (in degrees) to which line-type annotations are constrained.
*
* - The initial drawing direction is treated as the 0° reference point.
* - Snapped angles are calculated based on the specified increment.
* - If the increment is not a divisor of 360, angles reset after reaching 360°.
* - Example:
* - `restrictLineAngleTo: 45` → Snapped angles: 0°, 45°, 90°, ..., 360°
* - `restrictLineAngleTo: 100` → Snapped angles: 0°, 100°, 200°, 300°, 360°
* - Angular constraints apply only to lines and arrows when adjusted using the selector.
* - The original direction of the line is used as the reference during selector-based modifications.
*/
restrictLineAngleTo?: number;
}
/**
* Interface for a class ArrowSettings
*/
export interface ArrowSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the line head start style of the annotation.
*/
lineHeadStartStyle?: LineHeadStyle;
/**
* specifies the line head end style of the annotation.
*/
lineHeadEndStyle?: LineHeadStyle;
/**
* specifies the border dash array of the annotation.
*/
borderDashArray?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked arrow annotations.
* IsLock can be configured using arrow settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class RectangleSettings
*/
export interface RectangleSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the width of the annotation.
*/
width?: number;
/**
* specifies the height of the annotation.
*/
height?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked rectangle annotations.
* IsLock can be configured using rectangle settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class PdfAnnotationSettings
*/
export interface PdfAnnotationSettingsModel {
/**
* Get or set the bounds of the annotation.
*/
bound?: Rectangle;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* Gets or sets the fill color of the redacted area.
*/
fillColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked rectangle annotations.
* IsLock can be configured using rectangle settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class RedactionSettings
*/
export interface RedactionSettingsModel extends PdfAnnotationSettingsModel{
/**
* If true, disables the default redaction confirmation popup.
*/
disableConfirmationPopup?: boolean;
/**
* Gets or sets the opacity of the redaction marker.
* This property controls the transparency of the redaction marker's fill and border.
*/
markerOpacity?: number;
/**
* Gets or sets the border color of the redaction marker.
* This property defines the color of the border surrounding the redaction area.
*/
markerBorderColor?: string;
/**
* Gets or sets the fill color of the redaction marker.
* This property defines the color used to fill the redaction area.
*/
markerFillColor?: string;
/**
* Gets or sets the text to be displayed as an overlay in the redaction annotation.
* Specifies the string that will appear over the redacted area.
*/
overlayText?: string;
/**
* Gets or sets a value indicating whether the overlay text should repeat to fill the redaction area.
*/
isRepeat?: boolean;
/**
* Gets or sets the font color of the overlay text in the redaction annotation.
* Specifies the color used for the overlay text displayed within the redacted area.
*/
fontColor?: string;
/**
* Gets or sets the font size of the overlay text in the redaction annotation.
* This property determines the size of the overlay text displayed within the redacted area.
*/
fontSize?: number;
/**
* Gets or sets the font family used for the overlay text in the redaction annotation.
* Defines the font style of the overlay text that appears on the redacted area.
*/
fontFamily?: string;
/**
* Gets or sets the alignment of the overlay text displayed in the redaction annotation.
* This property defines how the overlay text is aligned within the bounds of the redaction area.
*/
textAlignment?: TextAlignment;
}
/**
* Interface for a class CircleSettings
*/
export interface CircleSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the width of the annotation.
*/
width?: number;
/**
* specifies the height of the annotation.
*/
height?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked circle annotations.
* IsLock can be configured using circle settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class ShapeLabelSettings
*/
export interface ShapeLabelSettingsModel {
/**
* specifies the opacity of the label.
*/
opacity?: number;
/**
* specifies the fill color of the label.
*/
fillColor?: string;
/**
* specifies the font color of the label.
*/
fontColor?: string;
/**
* specifies the font size of the label.
*/
fontSize?: number;
/**
* specifies the font family of the label.
*/
fontFamily?: string;
/**
* specifies the default content of the label.
*/
labelContent?: string;
/**
* specifies the default content of the label.
*/
notes?: string;
}
/**
* Interface for a class PolygonSettings
*/
export interface PolygonSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Gets or sets the allowed interactions for the locked polygon annotations.
* IsLock can be configured using polygon settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class StampSettings
*/
export interface StampSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the width of the annotation.
* The final rendered size preserves the base aspect ratio and is scaled
* to fit within the requested width × height.
*
* - If only width is provided, height is computed from the aspect ratio.
* - If both width and height are provided, the smaller limiting dimension
* is used so the annotation fits entirely within the container.
*/
width?: number;
/**
* specifies the height of the annotation.
* The final rendered size preserves the base aspect ratio and is scaled
* to fit within the requested width × height.
*
* - If only height is provided, height is computed from the aspect ratio.
* - If both width and height are provided, the smaller limiting dimension
* is used so the annotation fits entirely within the container.
*/
height?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* Provide option to define the required dynamic stamp items to be displayed in annotation toolbar menu.
*/
dynamicStamps?: DynamicStampItem[];
/**
* Provide option to define the required sign stamp items to be displayed in annotation toolbar menu.
*/
signStamps?: SignStampItem[];
/**
* Provide option to define the required standard business stamp items to be displayed in annotation toolbar menu.
*/
standardBusinessStamps?: StandardBusinessStampItem[];
/**
* Gets or sets the allowed interactions for the locked stamp annotations.
* IsLock can be configured using stamp settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class CustomStampSettings
*/
export interface CustomStampSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specifies the width of the annotation.
*/
width?: number;
/**
* specifies the height of the annotation.
*/
height?: number;
/**
* specifies the left position of the annotation.
*/
left?: number;
/**
* specifies the top position of the annotation.
*/
top?: number;
/**
* Specifies to maintain the newly added custom stamp element in the menu items.
*/
isAddToMenu?: boolean;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* Define the custom image path and it's name to be displayed in the menu items.
*/
customStamps?: CustomStampModel[];
/**
* If it is set as false. then the custom stamp items won't be visible in the annotation toolbar stamp menu items.
*/
enableCustomStamp?: boolean;
/**
* Gets or sets the allowed interactions for the locked custom stamp annotations.
* IsLock can be configured using custom stamp settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class DistanceSettings
*/
export interface DistanceSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the line head start style of the annotation.
*/
lineHeadStartStyle?: LineHeadStyle;
/**
* specifies the line head end style of the annotation.
*/
lineHeadEndStyle?: LineHeadStyle;
/**
* specifies the border dash array of the annotation.
*/
borderDashArray?: number;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the leader length of the annotation.
*/
leaderLength?: number;
/**
* Defines the cursor type for distance annotation.
*/
resizeCursorType?: CursorType;
/**
* Gets or sets the allowed interactions for the locked distance annotations.
* IsLock can be configured using distance settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class PerimeterSettings
*/
export interface PerimeterSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the line head start style of the annotation.
*/
lineHeadStartStyle?: LineHeadStyle;
/**
* specifies the line head end style of the annotation.
*/
lineHeadEndStyle?: LineHeadStyle;
/**
* specifies the border dash array of the annotation.
*/
borderDashArray?: number;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* Gets or sets the allowed interactions for the locked perimeter annotations.
* IsLock can be configured using perimeter settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class AreaSettings
*/
export interface AreaSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.
*/
author?: string;
/**
* specified the thickness of the annotation.
*/
thickness?: number;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the maxHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* Gets or sets the allowed interactions for the locked area annotations.
* IsLock can be configured using area settings.
*
* @default ['None']
*/
allowedInteractions?: AllowedInteraction[];
/**
* specifies whether the individual annotations are included or not in print actions.
*/
isPrint?: boolean;
/**
* specifies the subject of the annotation.
*/
subject?: string;
}
/**
* Interface for a class RadiusSettings
*/
export interface RadiusSettingsModel {
/**
* Get or set offset of the annotation.
*/
offset?: IPoint;
/**
* Get or set page number of the annotation.
*/
pageNumber?: number;
/**
* specifies the width of the annotation.
*/
width?: number;
/**
* specifies the height of the annotation.
*/
height?: number;
/**
* specifies the opacity of the annotation.
*/
opacity?: number;
/**
* specifies the fill color of the annotation.
*/
fillColor?: string;
/**
* specifies the stroke color of the annotation.
*/
strokeColor?: string;
/**
* specifies the author of the annotation.