Skip to content

Commit e4b9156

Browse files
1003205: Updated Pending Review Corrections Annotations
1 parent 824d421 commit e4b9156

24 files changed

Lines changed: 1183 additions & 124 deletions
285 KB
Loading

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/annotation-types/area-annotation.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ N> When in pan mode, selecting a measurement annotation switches the viewer to t
2727

2828
![Measurement toolbar](../../images/calibrate_tool.png)
2929

30-
### Add an area annotation programmatically
31-
32-
#### Enable area mode
30+
### Enable area mode
3331

3432
The PDF Viewer library allows drawing measurement annotations programmatically after enabling area mode in button clicks.
3533

@@ -67,7 +65,7 @@ document.getElementById('areaMode')?.addEventListener('click', function () {
6765
{% endhighlight %}
6866
{% endtabs %}
6967

70-
#### Add Area Annotation
68+
### Add an area annotation programmatically
7169

7270
The PDF Viewer library allows adding measurement annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation#annotation) method.
7371

@@ -134,7 +132,7 @@ Use the toolbar to change appearance:
134132

135133
See the sections below for screenshots and details.
136134

137-
### Edit the properties of area annotations
135+
#### Edit the properties of area annotations
138136

139137
The fill color, stroke color, thickness, and opacity can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar.
140138

@@ -264,6 +262,62 @@ pdfviewer.appendTo('#PdfViewer');
264262
{% endhighlight %}
265263
{% endtabs %}
266264

265+
## Set properties while adding Individual Annotation
266+
267+
Set properties for individual annotation before creating the control using `AreaSettings`.
268+
269+
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
270+
271+
Refer to the following code snippet to set the default Area settings.
272+
273+
```html
274+
<button id="Area">Add Area</button>
275+
```
276+
{% tabs %}
277+
{% highlight ts tabtitle="Standalone" %}
278+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, AreaSettings} from '@syncfusion/ej2-pdfviewer';
279+
280+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
281+
282+
const pdfviewer: PdfViewer = new PdfViewer();
283+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
284+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
285+
pdfviewer.appendTo('#PdfViewer');
286+
//Apply Area Settings while adding individual Annotation
287+
document.getElementById('Area')?.addEventListener('click', function () {
288+
pdfviewer.annotation.addAnnotation('Area', {
289+
offset: { x: 200, y: 500 },
290+
pageNumber: 1,
291+
vertexPoints: [
292+
{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }
293+
],
294+
fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'
295+
} as AreaSettings);
296+
});
297+
{% endhighlight %}
298+
{% highlight ts tabtitle="Server-Backed" %}
299+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, AreaSettings} from '@syncfusion/ej2-pdfviewer';
300+
301+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
302+
303+
const pdfviewer: PdfViewer = new PdfViewer();
304+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
305+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
306+
pdfviewer.appendTo('#PdfViewer');
307+
//Apply Area Settings while adding individual Annotation
308+
document.getElementById('Area')?.addEventListener('click', function () {
309+
pdfviewer.annotation.addAnnotation('Area', {
310+
offset: { x: 200, y: 500 },
311+
pageNumber: 1,
312+
vertexPoints: [
313+
{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }
314+
],
315+
fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'
316+
} as AreaSettings);
317+
});
318+
{% endhighlight %}
319+
{% endtabs %}
320+
267321
## Editing scale ratio and unit of the area measurement annotation
268322

269323
The scale ratio and unit of measurement can be modified using the scale ratio option provided in the context menu of the PDF Viewer control.

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/annotation-types/arrow-annotation.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ N> When in pan mode, selecting a shape annotation switches the viewer to text se
2727

2828
![Shape toolbar](../../images/shape_toolbar.png)
2929

30-
### Add an arrow annotation programmatically
31-
32-
#### Enable arrow mode
30+
### Enable arrow mode
3331

3432
The PDF Viewer library allows drawing shape annotations programmatically after enabling arrow mode in button clicks.
3533

@@ -67,7 +65,7 @@ document.getElementById('arrowMode')?.addEventListener('click', () => {
6765
{% endhighlight %}
6866
{% endtabs %}
6967

70-
#### Add Arrow Annotation
68+
### Add an arrow annotation programmatically
7169

7270
The PDF Viewer library allows adding shape annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation#annotation) method.
7371

@@ -125,7 +123,7 @@ You can select, move, and resize Arrow annotations directly in the viewer:
125123
- Resize/reshape: drag start/end handles to adjust its length and direction.
126124
- Delete or access more options from the context menu.
127125

128-
### Editing the properties of the arrow annotation
126+
#### Editing the properties of the arrow annotation
129127

130128
The fill color, stroke color, thickness, and opacity of arrow shape annotations can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar.
131129

@@ -247,6 +245,66 @@ pdfviewer.appendTo('#PdfViewer');
247245
{% endhighlight %}
248246
{% endtabs %}
249247

248+
## Set properties while adding Individual Annotation
249+
250+
Set properties for individual annotation before creating the control using `ArrowSettings`.
251+
252+
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
253+
254+
Refer to the following code snippet to set the default arrow settings.
255+
256+
```html
257+
<button id="arrow">Add Arrow</button>
258+
```
259+
{% tabs %}
260+
{% highlight ts tabtitle="Standalone" %}
261+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, ArrowSettings} from '@syncfusion/ej2-pdfviewer';
262+
263+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
264+
265+
const pdfviewer: PdfViewer = new PdfViewer();
266+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
267+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
268+
pdfviewer.appendTo('#PdfViewer');
269+
//Apply Arrow Settings while adding individual Annotation
270+
document.getElementById('arrow')?.addEventListener('click', function () {
271+
pdfviewer.annotation.addAnnotation('Arrow', {
272+
offset: { x: 200, y: 230 },
273+
pageNumber: 1,
274+
vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }],
275+
fillColor:'#ff1010ff',
276+
strokeColor:'#fff000',
277+
opacity:0.9,
278+
author: 'User 1',
279+
thickness: 1
280+
} as ArrowSettings);
281+
});
282+
{% endhighlight %}
283+
{% highlight ts tabtitle="Server-Backed" %}
284+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, ArrowSettings} from '@syncfusion/ej2-pdfviewer';
285+
286+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
287+
288+
const pdfviewer: PdfViewer = new PdfViewer();
289+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
290+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
291+
pdfviewer.appendTo('#PdfViewer');
292+
//Apply Arrow Settings while adding individual Annotation
293+
document.getElementById('arrow')?.addEventListener('click', function () {
294+
pdfviewer.annotation.addAnnotation('Arrow', {
295+
offset: { x: 200, y: 230 },
296+
pageNumber: 1,
297+
vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }],
298+
fillColor:'#ff1010ff',
299+
strokeColor:'#fff000',
300+
opacity:0.9,
301+
author: 'User 1',
302+
thickness: 1
303+
} as ArrowSettings);
304+
});
305+
{% endhighlight %}
306+
{% endtabs %}
307+
250308
N> In both [Arrow](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#arrowsettings) and [Line](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#linesettings) annotations Settings, the Fill Color option is available only when an arrowhead style is applied at the Start or End. If both Start and End arrowhead styles are set to None, lines do not support fill rendering and the Fill Color option remains disabled.
251309

252310
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/annotation-types/circle-annotation.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ N> When in pan mode, selecting a shape annotation switches the viewer to text se
2727

2828
![Shape toolbar](../../images/shape_toolbar.png)
2929

30-
### Add a circle annotation programmatically
31-
32-
#### Enable circle mode
30+
### Enable circle mode
3331

3432
The PDF Viewer library allows drawing Circle annotations programmatically after enabling Circle mode in button clicks.
3533

@@ -82,7 +80,7 @@ document.getElementById('setNone')?.addEventListener('click', () => {
8280
{% endhighlight %}
8381
{% endtabs %}
8482

85-
#### Add circle annotation
83+
### Add a circle annotation programmatically
8684

8785
Add shape annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation#annotation) method.
8886

@@ -141,7 +139,7 @@ You can select, move, and resize Circle annotations directly in the viewer:
141139
- Resize: drag the corner handles to adjust its diameter.
142140
- Delete or access more options from the context menu.
143141

144-
### Editing the properties of the circle annotation
142+
#### Editing the properties of the circle annotation
145143

146144
The fill color, stroke color, thickness, and opacity of circle shape annotations can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar.
147145

@@ -253,6 +251,66 @@ pdfviewer.appendTo('#PdfViewer');
253251
{% endhighlight %}
254252
{% endtabs %}
255253

254+
## Set properties while adding Individual Annotation
255+
256+
Set properties for individual annotation before creating the control using `CircleSettings`.
257+
258+
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
259+
260+
Refer to the following code snippet to set the default Circle settings.
261+
262+
```html
263+
<button id="Circle">Add Circle</button>
264+
```
265+
{% tabs %}
266+
{% highlight ts tabtitle="Standalone" %}
267+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, CircleSettings} from '@syncfusion/ej2-pdfviewer';
268+
269+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
270+
271+
const pdfviewer: PdfViewer = new PdfViewer();
272+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
273+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
274+
pdfviewer.appendTo('#PdfViewer');
275+
//Apply Circle Settings while adding individual Annotation
276+
document.getElementById('Circle')?.addEventListener('click', function () {
277+
pdfviewer.annotation.addAnnotation('Circle', {
278+
offset: { x: 200, y: 480 },
279+
pageNumber: 1,
280+
width: 150,
281+
height: 75,
282+
opacity: 0.5,
283+
strokeColor: '#FF0000',
284+
fillColor: '#000fff#',
285+
author: 'User1'
286+
} as CircleSettings);
287+
});
288+
{% endhighlight %}
289+
{% highlight ts tabtitle="Server-Backed" %}
290+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, CircleSettings} from '@syncfusion/ej2-pdfviewer';
291+
292+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
293+
294+
const pdfviewer: PdfViewer = new PdfViewer();
295+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
296+
pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';
297+
pdfviewer.appendTo('#PdfViewer');
298+
//Apply Circle Settings while adding individual Annotation
299+
document.getElementById('Circle')?.addEventListener('click', function () {
300+
pdfviewer.annotation.addAnnotation('Circle', {
301+
offset: { x: 200, y: 480 },
302+
pageNumber: 1,
303+
width: 150,
304+
height: 75,
305+
opacity: 0.5,
306+
strokeColor: '#FF0000',
307+
fillColor: '#000fff#',
308+
author: 'User1'
309+
} as CircleSettings);
310+
});
311+
{% endhighlight %}
312+
{% endtabs %}
313+
256314
[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master)
257315

258316
## See also

Document-Processing/PDF/PDF-Viewer/javascript-es6/annotations/annotation-types/distance-annotation.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ N> When in pan mode, selecting a measurement annotation switches the viewer to t
2727

2828
![Measurement toolbar](../../images/calibrate_tool.png)
2929

30-
### Add a distance annotation programmatically
31-
32-
#### Enable distance mode
30+
### Enable distance mode
3331

3432
The PDF Viewer component allows drawing Distance annotations programmatically after enabling Distance mode in button clicks.
3533

@@ -82,7 +80,7 @@ document.getElementById('setNone')?.addEventListener('click', () => {
8280
{% endhighlight %}
8381
{% endtabs %}
8482

85-
#### Add distance annotation
83+
### Add a distance annotation programmatically
8684

8785
Add measurement annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation#annotation) method.
8886

@@ -139,7 +137,7 @@ You can select, move, and resize Distance annotations directly in the viewer:
139137
- Resize: drag the end handles to adjust its length.
140138
- Delete or access more options from the context menu.
141139

142-
### Edit the properties of area annotations
140+
#### Edit the properties of area annotations
143141

144142
The fill color, stroke color, thickness, and opacity can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar.
145143

@@ -249,6 +247,58 @@ pdfviewer.appendTo('#PdfViewer');
249247
{% endhighlight %}
250248
{% endtabs %}
251249

250+
## Set properties while adding Individual Annotation
251+
252+
Set properties for individual annotation before creating the control using `DistanceSettings`.
253+
254+
> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings.
255+
256+
Refer to the following code snippet to set the default Distance settings.
257+
258+
```html
259+
<button id="Distance">Add Distance</button>
260+
```
261+
{% tabs %}
262+
{% highlight ts tabtitle="Standalone" %}
263+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, DistanceSettings} from '@syncfusion/ej2-pdfviewer';
264+
265+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
266+
267+
const pdfviewer: PdfViewer = new PdfViewer();
268+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
269+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
270+
pdfviewer.appendTo('#PdfViewer');
271+
//Apply Distance Settings while adding individual Annotation
272+
document.getElementById('Ink')?.addEventListener('click', function () {
273+
pdfviewer.annotation.addAnnotation('Distance', {
274+
offset: { x: 200, y: 230 },
275+
pageNumber: 1,
276+
vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }],
277+
fillColor: 'blue', opacity: 0.6, strokeColor: 'green'
278+
} as DistanceSettings);
279+
});
280+
{% endhighlight %}
281+
{% highlight ts tabtitle="Server-Backed" %}
282+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, DistanceSettings} from '@syncfusion/ej2-pdfviewer';
283+
284+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
285+
286+
const pdfviewer: PdfViewer = new PdfViewer();
287+
pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf';
288+
pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib';
289+
pdfviewer.appendTo('#PdfViewer');
290+
//Apply Distance Settings while adding individual Annotation
291+
document.getElementById('Ink')?.addEventListener('click', function () {
292+
pdfviewer.annotation.addAnnotation('Distance', {
293+
offset: { x: 200, y: 230 },
294+
pageNumber: 1,
295+
vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }],
296+
fillColor: 'blue', opacity: 0.6, strokeColor: 'green'
297+
} as DistanceSettings);
298+
});
299+
{% endhighlight %}
300+
{% endtabs %}
301+
252302
## Scale ratio and units
253303

254304
You can modify scale ratio and units using the Scale Ratio option in the context menu.

0 commit comments

Comments
 (0)