Skip to content

Commit 99d1909

Browse files
1007872: Annotation common files in Angular PDF Viewer
1 parent a725e32 commit 99d1909

19 files changed

Lines changed: 6107 additions & 282 deletions

Document-Processing-toc.html

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@
687687
<li><a href="/document-processing/pdf/pdf-viewer/angular/text-search">Text Search</a></li>
688688
<li>Annotation
689689
<ul>
690+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/overview">Overview</a></li>
690691
<li>Annotation Types
691692
<ul>
692693
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotation-types/highlight-annotation">Highlight</a></li>
@@ -710,19 +711,28 @@
710711
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotation-types/volume-annotation">Volume</a></li>
711712
</ul>
712713
</li>
713-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/text-markup-annotation">Text Markup Annotation</a></li>
714-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/shape-annotation">Shape Annotation</a></li>
715-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/stamp-annotation">Stamp Annotation</a></li>
716-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/sticky-notes-annotation">Sticky Notes Annotation</a></li>
717-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/measurement-annotation">Measurement Annotation</a></li>
718-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/free-text-annotation">Free Text Annotation</a></li>
719-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/line-angle-constraints">Line Angle Constraints</a></li>
720-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/ink-annotation">Ink Annotation</a></li>
721-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/import-export-annotation">Import and Export Annotations</a></li>
722-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/comments">Comments</a></li>
714+
<li><a href="/document-processing/pdf/pdf-viewer/angular/toolbar-customization/annotation-toolbar">Annotation Toolbar</a></li>
715+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/create-modify-annotation">Create and modify Annotation</a></li>
716+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/customize-annotation">Customize Annotation</a></li>
717+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/delete-annotation">Remove Annotation</a></li>
718+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotations-undo-redo">Undo or Redo Annotation Changes</a></li>
719+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotation-permission">Annotation Permission</a></li>
723720
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/signature-annotation">Handwritten Signature</a></li>
724-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotation-event">Annotations Events</a></li>
725-
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotations-in-mobile-view">Annotations in Mobile view</a></li>
721+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/line-angle-constraints">Line Angle Constraint</a></li>
722+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/custom-data">Adding custom Data in annotations</a></li>
723+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/flatten-annotation">Flatten Annotations into the PDF </a></li>
724+
<li>Export and Import Annotations
725+
<ul>
726+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/export-import/export-annotation">Export Annotation</a></li>
727+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/export-import/import-annotation">Import Annotation</a></li>
728+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/export-import/export-import-events">Export and Import Events</a></li>
729+
</ul>
730+
</li>
731+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/comments">Comments and Replies</a></li>
732+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotation-event">Annotation Events</a></li>
733+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/custom-tools">Custom tools</a></li>
734+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotations-in-mobile-view">Annotation in Mobile View</a></li>
735+
<li><a href="/document-processing/pdf/pdf-viewer/angular/annotation/annotations-api">APIs</a></li>
726736
</ul>
727737
</li>
728738
<li>Redaction

Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-event.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: post
3-
title: Annotations Events | Syncfusion
3+
title: Annotations Events in Angular Pdfviewer Control | Syncfusion
44
description: Learn here all about annotation events in Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2 and more.
55
platform: document-processing
66
control: PDF Viewer
@@ -10,9 +10,7 @@ domainurl: ##DomainURL##
1010

1111
# PDF Viewer annotation events in Angular
1212

13-
The PDF Viewer control supports several annotation events that enable applications to respond to user interactions—adding, moving, resizing, selecting, and removing annotations. Examples in this article reference the resource URL shown in the code samples.
14-
15-
The annotation events supported by the PDF Viewer control are:
13+
The PDF Viewer raises events for annotation and signature interactions (add, remove, move, resize, select, etc.). Handle these events to integrate custom workflows, telemetry, or UI updates. Code samples below demonstrate typical handlers — code blocks are preserved unchanged.
1614

1715
| Annotation events | Description |
1816
|---------------------------------|--------------------------------------------------------------------|
@@ -1538,4 +1536,3 @@ export class AppComponent implements OnInit {
15381536
}
15391537
{% endhighlight %}
15401538
{% endtabs %}
1541-
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
layout: post
3+
title: Annotations Permission in Angular PDF Viewer | Syncfusion
4+
description: Learn here all about how to use annotation permissions in Syncfusion Angular PDF Viewer using programmatic APIs.
5+
platform: document-processing
6+
control: PDF Viewer
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Annotation permissions in Angular
12+
13+
Use [annotationSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationsettings) to control creation-time permissions and default behavior for annotations in the PDF Viewer. These settings establish defaults for annotations created through the UI and programmatic flows.
14+
15+
## Common permissions
16+
17+
- `isLock`: Lock an annotation so it cannot be moved, resized, edited, or deleted.
18+
- `skipPrint`: Exclude annotations from the print output when printing from the viewer.
19+
- `skipDownload`: Exclude annotations from the exported/downloaded PDF.
20+
21+
Example: set default `annotationSettings` on the Angular `ejs-pdfviewer` component.
22+
23+
{% tabs %}
24+
{% highlight ts tabtitle="Standalone" %}
25+
import { Component } from '@angular/core';
26+
import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer';
27+
28+
@Component({
29+
selector: 'app-root',
30+
template: `
31+
<ejs-pdfviewer
32+
id="pdfViewer"
33+
[documentPath]="documentPath"
34+
[resourceUrl]="resourceUrl"
35+
[annotationSettings]="annotationSettings"
36+
style="height:650px;display:block">
37+
</ejs-pdfviewer>
38+
`,
39+
imports: [PdfViewerModule],
40+
providers: [ToolbarService, AnnotationService]
41+
})
42+
export class AppComponent {
43+
public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';
44+
public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib';
45+
46+
public annotationSettings: any = {
47+
author: 'XYZ',
48+
minHeight: 10,
49+
minWidth: 10,
50+
maxWidth: 100,
51+
maxHeight: 100,
52+
isLock: false,
53+
skipPrint: false,
54+
skipDownload: false,
55+
allowedInteractions: ['Resize']
56+
};
57+
}
58+
{% endhighlight %}
59+
{% endtabs %}
60+
61+
## Individual permissions
62+
63+
- `isPrint`: Controls whether a specific annotation participates in printing. Set to `false` to exclude only that annotation from print output.
64+
- `isLock`: Lock or unlock a specific annotation instance programmatically.
65+
66+
Example: set per-annotation defaults for text markup, shapes, and measurements as component bindings in Angular.
67+
68+
{% tabs %}
69+
{% highlight ts tabtitle="Standalone" %}
70+
import { Component } from '@angular/core';
71+
import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer';
72+
73+
@Component({
74+
selector: 'app-root',
75+
template: `
76+
<ejs-pdfviewer
77+
id="pdfViewer"
78+
[documentPath]="documentPath"
79+
[resourceUrl]="resourceUrl"
80+
[highlightSettings]="highlightSettings"
81+
[strikethroughSettings]="strikethroughSettings"
82+
[underlineSettings]="underlineSettings"
83+
[squigglySettings]="squigglySettings"
84+
85+
[lineSettings]="lineSettings"
86+
[arrowSettings]="arrowSettings"
87+
[rectangleSettings]="rectangleSettings"
88+
[circleSettings]="circleSettings"
89+
[polygonSettings]="polygonSettings"
90+
91+
[distanceSettings]="distanceSettings"
92+
[perimeterSettings]="perimeterSettings"
93+
[areaSettings]="areaSettings"
94+
[radiusSettings]="radiusSettings"
95+
[volumeSettings]="volumeSettings"
96+
97+
[freeTextSettings]="freeTextSettings"
98+
[inkAnnotationSettings]="inkAnnotationSettings"
99+
[stampSettings]="stampSettings"
100+
[stickyNotesSettings]="stickyNotesSettings"
101+
style="height:650px;display:block">
102+
</ejs-pdfviewer>
103+
`,
104+
imports: [PdfViewerModule],
105+
providers: [ToolbarService, AnnotationService]
106+
})
107+
export class AppComponent {
108+
public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf';
109+
public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib';
110+
111+
public highlightSettings = { author: 'QA', subject: 'Review', color: '#ffff00', opacity: 0.6 };
112+
public strikethroughSettings = { author: 'QA', subject: 'Remove', color: '#ff0000', opacity: 0.6 };
113+
public underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 };
114+
public squigglySettings = { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9 };
115+
116+
public lineSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true };
117+
public arrowSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true };
118+
public rectangleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true };
119+
public circleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true };
120+
public polygonSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true };
121+
122+
public distanceSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true };
123+
public perimeterSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true };
124+
public areaSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true };
125+
public radiusSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true };
126+
public volumeSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true };
127+
128+
public freeTextSettings = { borderColor: '#222222', opacity: 1, isLock: false, isPrint: true };
129+
public inkAnnotationSettings = { strokeColor: '#0000ff', thickness: 3, opacity: 0.8, isLock: false, isPrint: true };
130+
public stampSettings = { opacity: 0.9, isLock: false, isPrint: true };
131+
public stickyNotesSettings = { author: 'QA', subject: 'Review', opacity: 1, isLock: false, isPrint: true };
132+
}
133+
{% endhighlight %}
134+
{% endtabs %}
135+
136+
Behavior notes
137+
- isLock true: The annotation is locked; users cannot move, resize, or edit it through the UI until it is unlocked.
138+
- skipPrint true: All annotations are omitted from the print output initiated from the viewer.
139+
- skipDownload true: All annotations are omitted from the exported/downloaded PDF from the viewer.
140+
- isPrint on an individual annotation: Use this when you only want to exclude a particular annotation from printing while leaving others printable.
141+
142+
[View Sample on GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples)
143+
144+
## See also
145+
146+
- [Annotation Overview](../overview)
147+
- [Annotation Types](../annotation/annotation-types/area-annotation)
148+
- [Annotation Toolbar](../toolbar-customization/annotation-toolbar)
149+
- [Create and Modify Annotation](../annotation/create-modify-annotation)
150+
- [Customize Annotation](../annotation/customize-annotation)
151+
- [Remove Annotation](../annotation/delete-annotation)
152+
- [Handwritten Signature](../annotation/signature-annotation)
153+
- [Export and Import Annotation](../annotation/export-import/export-annotation)
154+
- [Annotation in Mobile View](../annotation/annotations-in-mobile-view)
155+
- [Annotation Events](../annotation/annotation-event)
156+
- [Annotation API](../annotation/annotations-api)

0 commit comments

Comments
 (0)