Skip to content

Commit 59099f3

Browse files
986772: Updated missing API in annotation
1 parent cad1dd1 commit 59099f3

File tree

8 files changed

+543
-4
lines changed

8 files changed

+543
-4
lines changed

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/free-text-annotation.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,40 @@ domainurl: ##DomainURL##
1212

1313
The PDF Viewer control provides options to add, edit, and delete free text annotations.
1414

15+
## Enable or Disbale Free Text annotation
16+
17+
Enables or disables the free text annotation feature in the PDF Viewer. For more details, see [enableFreeText API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablefreetext).
18+
19+
{% tabs %}
20+
{% highlight ts tabtitle="Standalone" %}
21+
22+
// Render the PDF viewer control
23+
var viewer = new ej.pdfviewer.PdfViewer({
24+
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
25+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
26+
enableFreeText: false
27+
});
28+
ej.pdfviewer.PdfViewer.Inject(
29+
ej.pdfviewer.Toolbar,
30+
ej.pdfviewer.Magnification,
31+
ej.pdfviewer.BookmarkView,
32+
ej.pdfviewer.ThumbnailView,
33+
ej.pdfviewer.TextSelection,
34+
ej.pdfviewer.TextSearch,
35+
ej.pdfviewer.Print,
36+
ej.pdfviewer.Navigation,
37+
ej.pdfviewer.LinkAnnotation,
38+
ej.pdfviewer.Annotation,
39+
ej.pdfviewer.FormFields,
40+
ej.pdfviewer.FormDesigner,
41+
ej.pdfviewer.PageOrganizer
42+
);
43+
44+
viewer.appendTo('#pdfViewer');
45+
46+
{% endhighlight %}
47+
{% endtabs %}
48+
1549
## Add a free text annotation to the PDF document
1650

1751
Free text annotations can be added to the PDF document using the annotation toolbar.
@@ -296,3 +330,45 @@ pdfviewer.appendTo('#PdfViewer');
296330

297331
{% endhighlight %}
298332
{% endtabs %}
333+
334+
N> To know more about FreeTextSettings, you can refer [FreeTextSettings API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#freetextsettings)
335+
336+
## Set default free text placeholder
337+
338+
The `isValidFreeText` property specifies whether newly added free text annotations display a placeholder. By default, `isValidFreeText` is `true`.
339+
- `true`: Displays **Type here** as placeholder text.
340+
- `false`: Leaves the annotation blank so that user-entered text remains visible.
341+
342+
For more information, see [isValidFreeText API documentation](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#isvalidfreetext).
343+
344+
{% tabs %}
345+
{% highlight ts tabtitle="Standalone" %}
346+
347+
// Initialize the PDF Viewer
348+
var viewer = new ej.pdfviewer.PdfViewer({
349+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2-pdfviewer-lib',
350+
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
351+
isValidFreeText: true, // Enables "Type here" as default text
352+
});
353+
354+
// Inject required modules
355+
ej.pdfviewer.PdfViewer.Inject(
356+
ej.pdfviewer.Toolbar,
357+
ej.pdfviewer.Magnification,
358+
ej.pdfviewer.Navigation,
359+
ej.pdfviewer.LinkAnnotation,
360+
ej.pdfviewer.ThumbnailView,
361+
ej.pdfviewer.BookmarkView,
362+
ej.pdfviewer.TextSelection,
363+
ej.pdfviewer.TextSearch,
364+
ej.pdfviewer.Print,
365+
ej.pdfviewer.Annotation,
366+
ej.pdfviewer.FormFields,
367+
ej.pdfviewer.FormDesigner
368+
);
369+
370+
// Render the viewer
371+
viewer.appendTo('#pdfViewer');
372+
373+
{% endhighlight %}
374+
{% endtabs %}

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/ink-annotation.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ The PDF Viewer control provides options to add, edit, and delete ink annotations
1414

1515
![Ink annotations overview](../images/ink_annotation.png)
1616

17+
## Enable or disable ink annotation
18+
19+
Enables or disables the ink annotation feature in the PDF Viewer; defaults to true. For details, see [enableInkAnnotation API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableinkannotation).
20+
21+
{% tabs %}
22+
{% highlight ts tabtitle="Standalone" %}
23+
24+
// Inject required modules
25+
ej.pdfviewer.PdfViewer.Inject(
26+
ej.pdfviewer.Toolbar,
27+
ej.pdfviewer.Magnification,
28+
ej.pdfviewer.Navigation,
29+
ej.pdfviewer.LinkAnnotation,
30+
ej.pdfviewer.ThumbnailView,
31+
ej.pdfviewer.BookmarkView,
32+
ej.pdfviewer.TextSelection,
33+
ej.pdfviewer.TextSearch,
34+
ej.pdfviewer.Print,
35+
ej.pdfviewer.Annotation,
36+
ej.pdfviewer.FormFields,
37+
ej.pdfviewer.FormDesigner
38+
);
39+
40+
// Initialize the PDF Viewer
41+
var viewer = new ej.pdfviewer.PdfViewer({
42+
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
43+
resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib",
44+
enableInkAnnotation: false // Disables ink annotation feature
45+
});
46+
47+
// Render the viewer
48+
viewer.appendTo('#pdfViewer');
49+
50+
{% endhighlight %}
51+
{% endtabs %}
52+
1753
## Add an ink annotation to the PDF document
1854

1955
Ink annotations can be added to the PDF document using the annotation toolbar.
@@ -267,4 +303,6 @@ pdfviewer.inkAnnotationSettings = {author: 'Syncfusion', strokeColor: 'green', t
267303
pdfviewer.appendTo('#PdfViewer');
268304

269305
{% endhighlight %}
270-
{% endtabs %}
306+
{% endtabs %}
307+
308+
N> To know more about FreeTextSettings, you can refer [inkAnnotationSettings API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#inkannotationsettings)

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/measurement-annotation.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,43 @@ pdfviewer.appendTo('#PdfViewer');
579579

580580
{% endhighlight %}
581581
{% endtabs %}
582+
583+
## Enable or disable import annotation measurement
584+
585+
Controls whether the PDF Viewer recalculates measurement values for imported measurement annotations. For details, see [enableImportAnnotationMeasurement API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableimportannotationmeasurement).
586+
587+
- true: Recalculates and displays measurement values using the viewer's current scale ratio and units.
588+
- false: Preserves the values embedded in the imported annotations (no recalculation), which can appear as original comment text.
589+
590+
{% tabs %}
591+
{% highlight ts tabtitle="Standalone" %}
592+
593+
// Inject required modules
594+
ej.pdfviewer.PdfViewer.Inject(
595+
ej.pdfviewer.Toolbar,
596+
ej.pdfviewer.Magnification,
597+
ej.pdfviewer.Navigation,
598+
ej.pdfviewer.LinkAnnotation,
599+
ej.pdfviewer.ThumbnailView,
600+
ej.pdfviewer.BookmarkView,
601+
ej.pdfviewer.TextSelection,
602+
ej.pdfviewer.TextSearch,
603+
ej.pdfviewer.Print,
604+
ej.pdfviewer.Annotation,
605+
ej.pdfviewer.FormFields,
606+
ej.pdfviewer.FormDesigner
607+
);
608+
609+
// Initialize the PDF Viewer
610+
var viewer = new ej.pdfviewer.PdfViewer({
611+
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
612+
resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib",
613+
// Enable or disable import annotation measurement customization
614+
enableImportAnnotationMeasurement: false
615+
});
616+
617+
// Render the viewer
618+
viewer.appendTo('#pdfViewer');
619+
620+
{% endhighlight %}
621+
{% endtabs %}

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/shape-annotation.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,42 @@ The PDF Viewer control provides options to add, edit, and delete shape annotatio
1818
* Circle
1919
* Polygon
2020

21+
## Enable or disable shape annotation support
22+
23+
Enables or disables the shape annotation feature in the PDF Viewer; defaults to true. For more information, see [enableShapeAnnotation API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableshapeannotation)
24+
25+
{% tabs %}
26+
{% highlight ts tabtitle="Standalone" %}
27+
28+
// Inject required modules
29+
ej.pdfviewer.PdfViewer.Inject(
30+
ej.pdfviewer.Toolbar,
31+
ej.pdfviewer.Magnification,
32+
ej.pdfviewer.Navigation,
33+
ej.pdfviewer.LinkAnnotation,
34+
ej.pdfviewer.ThumbnailView,
35+
ej.pdfviewer.BookmarkView,
36+
ej.pdfviewer.TextSelection,
37+
ej.pdfviewer.TextSearch,
38+
ej.pdfviewer.Print,
39+
ej.pdfviewer.Annotation,
40+
ej.pdfviewer.FormFields,
41+
ej.pdfviewer.FormDesigner
42+
);
43+
44+
// Initialize the PDF Viewer
45+
var viewer = new ej.pdfviewer.PdfViewer({
46+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
47+
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
48+
enableShapeAnnotation: false // Disables shape annotation feature
49+
});
50+
51+
// Render the viewer
52+
viewer.appendTo('#pdfViewer');
53+
54+
{% endhighlight %}
55+
{% endtabs %}
56+
2157
![Shape annotations overview](../images/shape_annot.png)
2258

2359
## Adding a shape annotation to the PDF document
@@ -496,6 +532,14 @@ Refer to the following code sample to set the default annotation settings.
496532

497533
## Set default properties during control initialization
498534

535+
The following properties can be used to set default shape annotation properties:
536+
537+
- **lineSettings**: Default LineSettingsModel. See [LineSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#linesettings)
538+
- **arrowSettings**: Default ArrowSettingsModel. See [ArrowSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#arrowsettings)
539+
- **rectangleSettings**: Default RectangleSettingsModel. See [RectangleSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#rectanglesettings)
540+
- **circleSettings**: Default CircleSettingsModel. See [CircleSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#circlesettings)
541+
- **polygonSettings**: Default PolygonSettingsModel. See [PolygonSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#polygonsettings)
542+
499543
Default properties for shape annotations can be set before creating the control using LineSettings, ArrowSettings, RectangleSettings, CircleSettings, and PolygonSettings.
500544

501545
{% tabs %}
@@ -531,4 +575,31 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc
531575
pdfviewer.appendTo('#PdfViewer');
532576

533577
{% endhighlight %}
534-
{% endtabs %}
578+
{% endtabs %}
579+
580+
## Enable or disable shape label visibility
581+
582+
Enables or disables the display of shape labels in the PDF Viewer; defaults to true. For more information, see [enableShapeLabel API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableshapelabel)
583+
584+
```js
585+
// Enable or disable shape labels.
586+
viewer.enableShapeLabel = true;
587+
```
588+
589+
## Configure shape label settings
590+
591+
Defines the settings for shape labels using the [ShapeLabelSettingsModel] API. For more information, see [shapeLabelSettings API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#shapelabelsettings)
592+
593+
```js
594+
// Change the shape label settings.
595+
viewer.shapeLabelSettings = {
596+
opacity: 1,
597+
fillColor: '#9c2592',
598+
borderColor: '#ff0000',
599+
fontColor: '#000',
600+
fontSize: 16,
601+
labelHeight: 24.6,
602+
labelMaxWidth: 151,
603+
labelContent: 'XYZ'
604+
};
605+
````

Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/signature-annotation.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,75 @@ pdfviewer.appendTo('#PdfViewer');
106106
{% endhighlight %}
107107
{% endtabs %}
108108

109+
## Control editability of handwritten signatures after download
110+
111+
Use the isSignatureEditable property to control whether handwritten signatures remain editable after download. When set to false, signatures are flattened and cannot be edited after the file is downloaded. When set to true, signatures are preserved as editable. Defaults to false.
112+
113+
For details, refer to the isSignatureEditable API.
114+
115+
{% tabs %}
116+
{% highlight ts tabtitle="Standalone" %}
117+
118+
// Inject required modules
119+
ej.pdfviewer.PdfViewer.Inject(
120+
ej.pdfviewer.Toolbar,
121+
ej.pdfviewer.Magnification,
122+
ej.pdfviewer.Navigation,
123+
ej.pdfviewer.Annotation,
124+
ej.pdfviewer.LinkAnnotation,
125+
ej.pdfviewer.ThumbnailView,
126+
ej.pdfviewer.BookmarkView,
127+
ej.pdfviewer.TextSelection,
128+
ej.pdfviewer.TextSearch,
129+
ej.pdfviewer.FormFields,
130+
ej.pdfviewer.FormDesigner,
131+
ej.pdfviewer.PageOrganizer
132+
);
133+
134+
// Initialize the PDF Viewer
135+
var pdfviewer = new ej.pdfviewer.PdfViewer({
136+
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
137+
resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib",
138+
isSignatureEditable: true // Allows handwritten signatures to remain editable after download
139+
});
140+
141+
// Render the viewer
142+
pdfviewer.appendTo('#PdfViewer');
143+
144+
{% endhighlight %}
145+
{% highlight ts tabtitle="Server-Backed" %}
146+
147+
// Inject required modules
148+
ej.pdfviewer.PdfViewer.Inject(
149+
ej.pdfviewer.Toolbar,
150+
ej.pdfviewer.Magnification,
151+
ej.pdfviewer.Navigation,
152+
ej.pdfviewer.Annotation,
153+
ej.pdfviewer.LinkAnnotation,
154+
ej.pdfviewer.ThumbnailView,
155+
ej.pdfviewer.BookmarkView,
156+
ej.pdfviewer.TextSelection,
157+
ej.pdfviewer.TextSearch,
158+
ej.pdfviewer.FormFields,
159+
ej.pdfviewer.FormDesigner,
160+
ej.pdfviewer.PageOrganizer
161+
);
162+
163+
// Initialize the PDF Viewer
164+
var pdfviewer = new ej.pdfviewer.PdfViewer({
165+
documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",
166+
serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/",
167+
isSignatureEditable: true // Allows handwritten signatures to remain editable after download
168+
});
169+
170+
// Render the viewer
171+
pdfviewer.appendTo('#PdfViewer');
172+
173+
{% endhighlight %}
174+
{% endtabs %}
175+
176+
> API reference: For more information, see [isSignatureEditable API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#issignatureeditable)
177+
109178
## Add a handwritten signature programmatically to the PDF document
110179

111180
With the PDF Viewer library, you can programmatically add a handwritten signature to the PDF Viewer control using the [**addAnnotation()**](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotation/#annotation) method.

0 commit comments

Comments
 (0)