| title | Annotation Events in JavaScript PDF Viewer control | Syncfusion |
|---|---|
| description | Learn here all about Annotations Events in Syncfusion JavaScript PDF Viewer component of Syncfusion Essential JS 2 and more. |
| platform | document-processing |
| control | PDF Viewer |
| documentation | ug |
| domainurl |
This page documents annotation-related events for the JavaScript PDF Viewer and when to use them. The PDF Viewer triggers events for user interactions and component state changes; use these events to run handlers that respond to specific occurrences. The sections below list each event, the associated event-args type, and an example handler.
| Event | Description |
|---|---|
annotationAdd |
Triggers when an annotation is added to a page in the PDF document. |
annotationDoubleClick |
Triggers when an annotation is double-clicked. |
annotationMouseLeave |
Triggers when the mouse pointer moves away from an annotation object. |
annotationMouseover |
Triggers when the mouse pointer moves over an annotation object. |
annotationMove |
Triggers when an annotation is moved on a page in the PDF document. |
annotationMoving |
Triggers while an annotation is being moved. |
annotationPropertiesChange |
Triggers when the properties of an annotation are modified on a PDF page. |
annotationRemove |
Triggers when an annotation is removed from a page in the PDF document. |
annotationResize |
Triggers when an annotation is resized on a page in the PDF document. |
annotationSelect |
Triggers when an annotation is selected on a page in the PDF document. |
annotationUnSelect |
Triggers when an annotation is unselected on a page in the PDF document. |
beforeAddFreeText |
Triggers before adding a text in the freeText annotation. |
addSignature |
Triggers when a signature is added to a page in the PDF document. |
removeSignature |
Triggers when a signature is removed from a page in the PDF document. |
resizeSignature |
Triggers when a signature is resized on a page in the PDF document. |
signaturePropertiesChange |
Triggers when the properties of a signature are changed on a page in the PDF document. |
signatureSelect |
Triggers when a signature is selected on a page in the PDF document. |
signatureUnselect |
Triggers when a signature is unselected on a page in the PDF document. |
The annotationAdd event is triggered when an annotation is added to a PDF document's page.
For event data, see AnnotationAddEventArgs. It provides properties such as annotationId, pageNumber, annotationType, and bounds.
The following example illustrates how to handle the annotationAdd event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}var viewer = new ej.pdfviewer.PdfViewer ({
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
annotationAdd: function (args) {
console.log('Annotation added with ID: ' + args.annotationId);
console.log('Annotation type: ' + args.annotationType);
}
});
ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner,ej.pdfviewer.PageOrganizer);
viewer.appendTo('#pdfViewer');The annotationDoubleClick event is triggered when an annotation is double-clicked.
For event data, see AnnotationDoubleClickEventArgs.
The following example illustrates how to handle the annotationDoubleClick event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
annotationDoubleClick: function (args) {
console.log('Annotation double-clicked on page: ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The annotationMouseLeave event is triggered when the user's mouse pointer moves away from an annotation object.
For event data, see AnnotationMouseLeaveEventArgs.
The following example illustrates how to handle the annotationMouseLeave event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationMouseLeave: function (args) {
console.log('Annotation mouse leave event is triggered for annotation with ID: ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The annotationMouseover event is triggered when the mouse is moved over an annotation object.
For event data, see AnnotationMouseOverEventArgs.
The following example illustrates how to handle the annotationMouseover event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationMouseover: function (args) {
console.log('Annotation mouse over event is triggered for annotation with ID: ' + args.annotationId);
}
});
viewer.appendTo('#pdfViewer');The annotationMove event is triggered when an annotation is moved over the page of the PDF document.
For event data, see AnnotationMoveEventArgs.
The following example illustrates how to handle the annotationMove event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationMove: function (args) {
console.log('Annotation moved. ID: ' + args.annotationId + ' on page ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The annotationMoving event is triggered while an annotation is being moved.
For event data, see AnnotationMovingEventArgs.
The following example illustrates how to handle the annotationMoving event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationMoving: function (args) {
console.log('Annotation is being moved. Current Action: ' + args.currentPosition);
}
});
viewer.appendTo('#pdfViewer');The annotationPropertiesChange event is triggered when an annotation's property is modified on a PDF document page.
For event data, see AnnotationPropertiesChangeEventArgs. It provides properties such as annotationId, pageNumber, and action.
The following example illustrates how to handle the annotationPropertiesChange event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationPropertiesChange: function (args) {
console.log('Annotation properties changed for ID: ' + args.annotationId);
console.log('isThicknessChanged: ' + args.isThicknessChanged);
}
});
viewer.appendTo('#pdfViewer');The annotationRemove event is triggered when an annotation is removed from a PDF document's page.
For event data, see AnnotationRemoveEventArgs. It provides properties such as annotationId and pageNumber.
The following example illustrates how to handle the annotationRemove event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationRemove: function (args) {
console.log('Annotation removed with ID: ' + args.annotationId);
}
});
viewer.appendTo('#pdfViewer');The annotationResize event is triggered when an annotation is resized on a PDF document page.
For event data, see AnnotationResizeEventArgs.
The following example illustrates how to handle the annotationResize event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationResize: function (args) {
console.log('Annotation resized. ID: ' + args.annotationId);
}
});
viewer.appendTo('#pdfViewer');The annotationSelect event is triggered when an annotation is selected on a PDF document's page.
For event data, see AnnotationSelectEventArgs.
The following example illustrates how to handle the annotationSelect event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationSelect: function (args) {
console.log('Annotation selected with ID: ' + args.annotationId);
}
});
viewer.appendTo('#pdfViewer');The annotationUnselect event is triggered when an annotation is unselected from the PDF document's page.
For event data, see AnnotationUnSelectEventArgs.
The following example illustrates how to handle the annotationUnselect event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
annotationUnSelect: function (args) {
console.log('Annotation unselected with ID: ' + args.annotationId);
}
});
viewer.appendTo('#pdfViewer');The beforeAddFreeText event is triggered before adding a text in the freeText annotation.
For event data, see BeforeAddFreeTextEventArgs.
The following example illustrates how to handle the beforeAddFreeText event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
beforeAddFreeText: function (args) {
console.log('Before adding free text on page: ' + args.pageIndex);
// Set args.cancel to true to prevent adding the free text annotation
// args.cancel = true;
}
});
viewer.appendTo('#pdfViewer');The addSignature event is triggered when a signature is added to a page of a PDF document.
For event data, see AddSignatureEventArgs. It provides properties such as pageNumber.
The following example illustrates how to handle the addSignature event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
addSignature: function (args) {
console.log('Signature added to page: ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The removeSignature event is triggered when the signature is removed from the page of a PDF document.
For event data, see RemoveSignatureEventArgs. It provides properties such as pageNumber.
The following example illustrates how to handle the removeSignature event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
removeSignature: function (args) {
console.log('Signature removed from page: ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The resizeSignature event is triggered when the signature is resized and placed on a page of a PDF document.
For event data, see ResizeSignatureEventArgs.
The following example illustrates how to handle the resizeSignature event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
resizeSignature: function (args) {
console.log('Signature resized on page ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The signaturePropertiesChange event is triggered when the property of the signature is changed in the page of the PDF document.
For event data, see SignaturePropertiesChangeEventArgs.
The following example illustrates how to handle the signaturePropertiesChange event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
signaturePropertiesChange: function (args) {
console.log('Signature properties changed on page ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The signatureSelect event is triggered when signature is selected over the page of the PDF document.
For event data, see SignatureSelectEventArgs.
The following example illustrates how to handle the signatureSelect event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
signatureSelect: function (args) {
console.log('Signature selected on page ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');The signatureUnselect event is triggered when signature is unselected over the page of the PDF document.
For event data, see SignatureUnSelectEventArgs.
The following example illustrates how to handle the signatureUnselect event.
{% raw %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 2</title>
<!-- Essential JS 2 tailwind3 theme -->
<link href="https://cdn.syncfusion.com/ej2/31.2.2/tailwind3.css" rel="stylesheet" type="text/css"/>
<!-- Essential JS 2 PDF Viewer's global script -->
<script src="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2.min.js" type="text/javascript"></script>
</head>
<body>
<div id='container'>
<div id='pdfViewer' style="height:500px;width:100%;">
</div>
</div>
</body>
</html>
{% endraw %}ej.pdfviewer.PdfViewer.Inject(
ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation,
ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.Annotation,
ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer
);
var viewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
signatureUnselect: function (args) {
console.log('Signature unselected on page ' + args.pageIndex);
}
});
viewer.appendTo('#pdfViewer');