Skip to content

Commit caecd92

Browse files
984540: JS how-to module documentation revamp
1 parent 5b72968 commit caecd92

File tree

54 files changed

+554
-651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+554
-651
lines changed

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-annotation-in-text-search-js.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
---
22
layout: post
3-
title: Add Annotation in Text Search in JavaScript PdfViewer | Syncfusion
4-
description: Learn how to add rectangle annotations using search text bounds in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Add rectangle annotation from textSearch in JavaScript PDF Viewer | Syncfusion
4+
description: Learn to add rectangle annotations using text search bounds in the JavaScript PDF Viewer component, including initialization and search controls.
55
platform: document-processing
66
control: PDF Viewer
7-
publishingplatform: Javascript
87
documentation: ug
98
domainurl: ##DomainURL##
109
---
1110

12-
# Add Rectangle Annotations Using Search Text Bounds in PDF Viewer
11+
# Add rectangle annotations using text search bounds in PDF Viewer
1312

14-
## Overview
13+
A concise guide to adding rectangle annotations at highlighted text search results in the JavaScript PDF Viewer to visually emphasize matches and improve readability.
1514

16-
This guide demonstrates how to add rectangle annotations based on the bounds of highlighted search text in the PDF Viewer. This technique is useful for emphasizing search results with visual markers in annotation-supported applications.
17-
18-
## Steps to Add Rectangle Annotations on Search Result Highlight
15+
## Steps to add rectangle annotations on search result highlight
1916

2017
**Step 1:** Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started) to create a simple PDF Viewer sample.
2118

22-
**Step 2:** Initialize the PDF Viewer with Required Modules
19+
**Step 2:** Initialize the PDF Viewer with the required modules
2320

2421
```js
2522
var pdfviewer = new ej.pdfviewer.PdfViewer({
@@ -31,9 +28,9 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc
3128
pdfviewer.appendTo('#PdfViewer');
3229
```
3330

34-
**Step 3:** Implement code blocks to automatically add Rectangle Annotation on Search Result Highlight
31+
**Step 3:** Add a rectangle annotation when a search result is highlighted
3532

36-
Define a callback function for the `textSearchHighlight` event to add rectangle annotations
33+
Define a callback for the `textSearchHighlight` event to add a rectangle annotation at each match.
3734

3835
```js
3936
// Highlight event handler for text search, which adds a rectangle annotation where the text is found
@@ -50,17 +47,17 @@ pdfviewer.textSearchHighlight = function(args){
5047
}
5148
```
5249

53-
**Step 3:** Add Search Controls
50+
**Step 4:** Add search controls
5451

55-
Ensure you have the appropriate HTML buttons for text search operations
52+
Ensure that the HTML includes buttons for text search operations.
5653

5754
```html
5855
<button id="searchText">Search</button>
5956
<button id="searchNext">Next</button>
6057
<button id="searchCancel">Cancel</button>
6158
```
6259

63-
Use the following JavaScript to handle search controls:
60+
Use the following JavaScript code to handle search controls:
6461

6562
```js
6663
// Event listener for initiating a search
@@ -79,6 +76,6 @@ document.getElementById("searchCancel").addEventListener("click", function() {
7976
});
8077
```
8178

82-
By following this guide, you will enable the PDF Viewer to add rectangle annotations at search result locations, thus increasing the visibility of search results in your application.
79+
Following these steps enables the PDF Viewer to add rectangle annotations at search result locations, improving the visibility of matches.
8380

8481
[View Sample in GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master/How%20to/)

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-header-value.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
---
22
layout: post
3-
title: Add header value in Javascript Pdfviewer control | Syncfusion
4-
description: Learn here all about Add header value in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Add header values to AJAX requests in JavaScript PDF Viewer | Syncfusion
4+
description: Learn how to include custom headers in PDF Viewer AJAX requests using ajaxRequestSettings and ajaxHeaders in the JavaScript PDF Viewer component.
55
platform: document-processing
6-
control: Add header value
7-
publishingplatform: Javascript
6+
control: PDF Viewer
87
documentation: ug
9-
domainurl: ##DomainURL##
108
---
119

12-
# Add header value in Javascript Pdfviewer control
10+
# Add header values in the JavaScript PDF Viewer
1311

14-
To add header values to an AJAX request made by a Syncfusion PDF Viewer, you can use the **ajaxHeaders** property available in the [**ajaxRequestSettings**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#ajaxrequestsettings) module of the PDF Viewer. This property allows you to specify custom headers for the AJAX request.
12+
Use the ajaxHeaders property in the PDF Viewer’s [ajaxRequestSettings](https://ej2.syncfusion.com/documentation/api/pdfviewer/#ajaxrequestsettings) to include custom headers with each AJAX request.
1513

16-
Here is an example of how you can use the **ajaxRequestSettings** property to add a custom header to an AJAX request made by the PDF Viewer:
14+
Example: Add a custom Authorization header using ajaxRequestSettings
1715

1816
```ts
1917

@@ -31,4 +29,5 @@ viewer.ajaxRequestSettings = {
3129

3230
```
3331

34-
Find the sample [how to add custom headers in AjaxRequestSettings](https://stackblitz.com/edit/typescript-nv1way?file=index.ts)
32+
Sample: How to add custom headers using ajaxRequestSettings
33+
[StackBlitz example](https://stackblitz.com/edit/typescript-nv1way?file=index.ts)

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-new-page-to-the-pdf-document.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
---
22
layout: post
3-
title: Add new page to the pdf document in Javascript Pdfviewer control | Syncfusion
4-
description: Learn here all about Add new page to the pdf document in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Add a new page to a PDF document in JavaScript PDF Viewer control | Syncfusion
4+
description: Learn how to append a new page to a loaded PDF document in the Syncfusion JavaScript PDF Viewer control using the PDF library service.
55
platform: document-processing
6-
control: Add new page to the pdf document
7-
publishingplatform: Javascript
6+
control: PDF Viewer
87
documentation: ug
98
domainurl: ##DomainURL##
109
---
1110

12-
# Add new page to the pdf document in Javascript Pdfviewer control
11+
# Add a new page to a PDF document in JavaScript PDF Viewer control
1312

14-
The PDF Viewer library allows you to add a new page to the PDF document using the PDF library.
13+
The JavaScript PDF Viewer library can append a blank page to any loaded PDF document through the accompanying PDF library service.
1514

16-
**Step 1:** Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started/) to create a simple PDF Viewer sample.
15+
**Step 1:** Follow the guidance in the [Getting started with the JavaScript PDF Viewer](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started/) article to configure a working sample.
1716

18-
**Step 2:** Follow the steps provided in the [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/how-to/create-pdfviewer-service/) to create the PDF Viewer web service.
17+
**Step 2:** Complete the web service setup by using this [guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/how-to/create-pdfviewer-service/).
1918

20-
**Step 3:** Add the following code sample in the PDF Viewer controller code to add a new page in the PDF document using the PDF library.
19+
**Step 3:** Add the following controller action to insert a new page into the loaded PDF document before returning it to the viewer.
2120

2221
```javascript
2322

@@ -64,4 +63,4 @@ public IActionResult Load([FromBody] Dictionary<string, string> jsonObject)
6463
}
6564
```
6665

67-
[View sample in GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master/How%20to/Add%20new%20page%20to%20the%20PDF%20document%20using%20PDF%20library)
66+
[View the sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master/How%20to/Add%20new%20page%20to%20the%20PDF%20document%20using%20PDF%20library)

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-save-button-js.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
---
22
layout: post
3-
title: Add Save button in Javascript Pdfviewer control | Syncfusion
4-
description: Learn here all about How to add save button in Toolbar in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Add Save button to the built-in toolbar in JavaScript PDF Viewer | Syncfusion
4+
description: Learn how to add, show, hide, enable, and disable a custom Save button in the built-in toolbar of the JavaScript PDF Viewer component.
55
platform: document-processing
66
control: Toolbar
7-
publishingplatform: Javascript
87
documentation: ug
98
domainurl: ##DomainURL##
109
---
1110

12-
# Add Save button in Built-In Toolbar
11+
# Add a Save button to the built-in toolbar
1312

14-
PDF Viewer allows you to customize (add, show, hide, enable, and disable) existing items in a toolbar.
13+
PDF Viewer supports customizing toolbar items, including adding, showing, hiding, enabling, and disabling items.
1514

16-
* Save button - `Save` button-item can defined by [**CustomToolbarItemModel**](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/customToolbarItem/) and with existing items in [**ToolbarSettings**](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarSettings/) property. Newly added save button-item click action can be defined in [`toolbarclick`](https://ej2.syncfusion.com/javascript/documentation/api/toolbar/clickEventArgs/).
15+
- Save button: The Save button can be defined using [CustomToolbarItemModel](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/customToolbarItem/) and included alongside existing items via [ToolbarSettings](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarSettings/). Handle the click action using [`toolbarclick`](https://ej2.syncfusion.com/javascript/documentation/api/toolbar/clickEventArgs/).
1716

18-
* Show, Hide - `Save` button-item can be shown or hidden using the [`ToolbarSettings`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarSettings/) property. Pre-defined toolbar items are available with [`ToolbarItem`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarItem/).
17+
- Show or hide: The Save button can be shown or hidden using [ToolbarSettings](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarSettings/). Predefined items are listed under [`ToolbarItem`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbarItem/).
1918

20-
* Enable, Disable - `Save` button-item can be enabled or disable using [`enabletoolbaritem`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbar/#enabletoolbaritem)
19+
- Enable or disable: The Save button can be enabled or disabled using [`enabletoolbaritem`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/toolbar/#enabletoolbaritem).
2120

2221
{% tabs %}
2322
{% highlight js tabtitle="Standalone" %}
@@ -79,35 +78,33 @@ function OnCreateSearch() {
7978
{% endhighlight %}
8079
{% endtabs %}
8180

81+
N> Default toolbar items: ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm']
8282

83-
N> Default value of toolbar items is ['OpenOption', 'PageNavigationTool','MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption','UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm']
83+
### Align property
8484

85-
### Align Property
85+
Specifies the alignment of the Save button within the toolbar.
8686

87-
The align property is used to specify the alignment of a `save` button-item within the toolbar.
87+
- Left: Aligns the item to the left side of the toolbar.
88+
- Right: Aligns the item to the right side of the toolbar.
8889

89-
`Left`: Aligns the item to the left side of the toolbar.
90-
`Right`: Aligns the item to the right side of the toolbar.
90+
### Tooltip property
9191

92-
### Tooltip Property
92+
Sets the tooltip text for the Save button. The tooltip provides additional information on hover.
9393

94-
The tooltip property is used to set the tooltip text for a `save` button-item. Tooltip provides additional information when a user hovers over the item.
94+
### CssClass property
9595

96-
### CssClass Property
96+
Applies custom CSS classes to the Save button for styling.
9797

98-
The cssClass property is used to apply custom CSS classes to a `save` button-item. It allows custom styling of the `save` button-item.
98+
### Prefix property
9999

100-
### Prefix Property
100+
Sets the CSS class or icon to add as a prefix to the Save button content.
101101

102-
The prefix property is used to set the CSS class or icon that should be added as a prefix to the existing content of the `save` button-item.
102+
### ID property
103103

104-
### ID Property
104+
The id property within a CustomToolbarItemModel is required and uniquely identifies each toolbar item for configuration and interaction.
105105

106-
The id property within a CustomToolbarItemModel is a compulsory attribute that plays a vital role in toolbar customization. It serves as a unique identifier for each toolbar item, facilitating distinct references and interactions.
106+
When defining or customizing toolbar items, assign a specific, descriptive id to each item. These properties are commonly used when defining custom toolbar items with `CustomToolbarItemModel` in the context of Syncfusion PDF Viewer. When configuring the toolbar using the `ToolbarSettings` property, include these properties to customize appearance and behavior.
107107

108-
When defining or customizing toolbar items, it is mandatory to assign a specific and descriptive id to each item.
109-
These properties are commonly used when defining custom toolbar items with the `CustomToolbarItemModel`` in the context of Syncfusion PDF Viewer. When configuring the toolbar using the `ToolbarSettings`` property, you can include these properties to customize the appearance and behavior of each toolbar item.
110-
111-
N> When customizing `save` button-item, you have the flexibility to include either icons or text based on your design preference.
108+
N> When customizing the Save button, icons or text can be used based on design preference.
112109

113110
[View sample in GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master/How%20to/Add%20Save%20Button%20In%20Toolbar)

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/annotation-selector.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
22
layout: post
3-
title: Annotation selector in Javascript Pdfviewer control | Syncfusion
4-
description: Learn here all about Annotation selector in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Customize annotation selectors in JavaScript PDF Viewer
4+
description: Learn how to customize annotation selectors in the JavaScript PDF Viewer component using annotationSelectorSettings with examples.
55
platform: document-processing
6-
control: Annotation selector
7-
publishingplatform: Javascript
6+
control: PDF Viewer
87
documentation: ug
98
domainurl: ##DomainURL##
109
---
1110

12-
# Annotation selector in Javascript Pdfviewer control
11+
# Customize annotation selectors in JavaScript PDF Viewer
1312

14-
To customize the annotation selector in Syncfusion PDF Viewer, you can use the [**annotationSelectorSettings**](https://ej2.syncfusion.com/documentation/api/pdfviewer/#annotationselectorsettings) property of the PdfViewer control.
13+
Customize the annotation selector using the [annotationSelectorSettings](https://ej2.syncfusion.com/documentation/api/pdfviewer/#annotationselectorsettings) property of the PDF Viewer.
1514

16-
Here is an example of how you can customize the selector of the shape annotation:
15+
Example: Customize the selector of a shape annotation
1716

1817
```
1918
@@ -30,4 +29,5 @@ document.getElementById('annotationSelector').addEventListener('click', () => {
3029

3130
```
3231

33-
Find the sample [how to customize the annotation selector](https://stackblitz.com/edit/js-5p3ae6?file=index.js)
32+
Sample: [How to customize the annotation selector]
33+
(https://stackblitz.com/edit/js-5p3ae6?file=index.js)

Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/change-author-name-using-annotation-settings.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
---
22
layout: post
3-
title: Change author name using annotation settings in Javascript Pdfviewer control | Syncfusion
4-
description: Learn here all about Change author name using annotation settings in Syncfusion Javascript Pdfviewer control of Syncfusion Essential JS 2 and more.
3+
title: Change author name using annotation settings in JavaScript PDF Viewer | Syncfusion
4+
description: Learn how to change the author name and related annotation settings using the annotationSettings API in the JavaScript PDF Viewer.
55
platform: document-processing
6-
control: Change author name using annotation settings
7-
publishingplatform: Javascript
6+
control: PDF Viewer
87
documentation: ug
98
domainurl: ##DomainURL##
109
---
1110

12-
# Change author name using annotation settings in Javascript Pdfviewer control
11+
# Change author name using annotation settings in JavaScript PDF Viewer
1312

14-
The Essential JavaScript PDF Viewer supports to customize a single property of the annotation settings by exposing an API for the properties common to all the annotations.
13+
The PDF Viewer allows customizing individual annotation settings using the annotationSettings API, which exposes properties common to all annotations.
1514

16-
**API Name** : annotationSettings
15+
API name: annotationSettings
1716

18-
|Property Name|Data type & Default Value|Description|
17+
| Property Name | Data type & Default Value | Description |
1918
|---|---|---|
20-
|author|String(“Guest”)|specifies the author of the annotation.|
21-
|minWidth|Number(0)|specifies the minWidth of the annotation.|
22-
|maxWidth|Number(0)|specifies the maxWidth of the annotation.|
23-
|minHeight|Number(0)|specifies the minHeight of the annotation.|
24-
|maxHeight|Number(0)|specifies the maxHeight of the annotation.|
25-
|isLock|Boolean(false)|specifies the locked action of the annotations. [If set true unable to select the annotations]|
26-
|isPrint|Boolean(true)|specifies whether the annotations are included or not in Print actions.|
27-
|isDownload|Boolean(true|specifies whether the annotations are included or not in Download actions.|
28-
|Free Text Settings|
29-
|allowOnlyTextInput|Boolean(false)|specifies the allow only text action of the free text annotation. [If set true unable to move or resize the annotations]|
30-
31-
You can change the author name and the other properties using the annotationSettings API as in the following code sample.
19+
| author | String ("Guest") | Specifies the author of the annotation. |
20+
| minWidth | Number (0) | Specifies the minimum width of the annotation. |
21+
| maxWidth | Number (0) | Specifies the maximum width of the annotation. |
22+
| minHeight | Number (0) | Specifies the minimum height of the annotation. |
23+
| maxHeight | Number (0) | Specifies the maximum height of the annotation. |
24+
| isLock | Boolean (false) | Specifies whether the annotation is locked. If true, the annotation cannot be selected. |
25+
| isPrint | Boolean (true) | Specifies whether the annotation is included in print actions. |
26+
| isDownload | Boolean (true) | Specifies whether the annotation is included in download actions. |
27+
| Free Text Settings |
28+
| allowOnlyTextInput | Boolean (false) | Specifies text-only mode for free text annotations. If true, moving or resizing is disabled. |
29+
30+
Change the author name and other properties using the annotationSettings API as shown below.
3231

3332
{% tabs %}
3433
{% highlight ts tabtitle="Standalone" %}

0 commit comments

Comments
 (0)