Skip to content

Commit 5a50b97

Browse files
986772: Updated JavaScript Missing API
1 parent 59099f3 commit 5a50b97

File tree

14 files changed

+348
-9
lines changed

14 files changed

+348
-9
lines changed

Document-Processing/PDF/PDF-Viewer/javascript-es5/download.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ domainurl: ##DomainURL##
99
---
1010
# Download in JavaScript PDF Viewer control
1111

12-
The PDF Viewer supports downloading the loaded PDF file. You can enable/disable the download using the following code snippet.
12+
The PDF Viewer supports downloading the loaded PDF file.
13+
14+
## Enable or disable download option
15+
Use the [enableDownload](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enabledownload) property to enable or disable the download option when the PDF Viewer is loaded. It accepts a boolean value and defaults to true.
16+
17+
You can enable/disable the download using the following code snippet.
1318

1419
```html
1520
{% raw %}
@@ -99,6 +104,14 @@ document.getElementById('download').addEventListener('click', function () {
99104
{% endhighlight %}
100105
{% endtabs %}
101106

107+
## Customize download file name
108+
109+
Use the [downloadFileName](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#downloadfilename) property to set the download file name for the PDF Viewer. It accepts a string value. For example:
110+
111+
```js
112+
viewer.downloadFileName = 'Document_Downloaded';
113+
```
114+
102115
## How to get the base64 string while downloading the PDF document
103116

104117
The [downloadEnd](https://ej2.syncfusion.com/documentation/api/pdfviewer/#downloadend) event of the PDF viewer allows you to get the downloaded document as a base64 string.

Document-Processing/PDF/PDF-Viewer/javascript-es5/form-designer/create-programmatically.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,38 @@ The PDF Viewer component provides options to add, edit, and delete form fields.
2121
- Signature field
2222
- Initial field
2323

24+
## Enable or Disable form designer toolbar
25+
26+
Inject the FormDesigner module and set `enableFormDesigner` to `false` to display the Form Designer icon on the toolbar. The default value is `true`. You can refer [enableFormDesigner API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableformdesigner) for more information.
27+
28+
Use the following code to enable or disable the form designer toolbar option.
29+
30+
```js
31+
// Inject required modules
32+
ej.pdfviewer.PdfViewer.Inject(
33+
ej.pdfviewer.Toolbar,
34+
ej.pdfviewer.Magnification,
35+
ej.pdfviewer.Navigation,
36+
ej.pdfviewer.LinkAnnotation,
37+
ej.pdfviewer.ThumbnailView,
38+
ej.pdfviewer.BookmarkView,
39+
ej.pdfviewer.TextSelection,
40+
ej.pdfviewer.Annotation,
41+
ej.pdfviewer.FormDesigner,
42+
ej.pdfviewer.FormFields
43+
);
44+
45+
// Initialize the PDF Viewer
46+
var pdfviewer = new ej.pdfviewer.PdfViewer({
47+
documentPath: 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf',
48+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
49+
enableFormDesigner: false // Disables the form designer feature
50+
});
51+
52+
// Render the viewer
53+
pdfviewer.appendTo('#PdfViewer');
54+
```
55+
2456
## Add a form field to PDF document programmatically
2557

2658
Use the addFormField method to add form fields programmatically. Pass the form field type and the corresponding property object as parameters. The following example demonstrates adding multiple fields on document load.

Document-Processing/PDF/PDF-Viewer/javascript-es5/form-designer/create-with-user-interface-interaction.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ The PDF Viewer component supports interactive form field design, including drawi
2323

2424
## Enable or Disable form designer toolbar
2525

26-
Inject the FormDesigner module and set enableFormDesignerToolbar to true to display the Form Designer icon on the toolbar. The default value is true. Use the following code to enable the toolbar option.
26+
Inject the FormDesigner module and set enableFormDesignerToolbar to true to display the Form Designer icon on the toolbar. The default value is true.
2727

28+
You can refer to [enableFormDesignerToolbar API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableformdesigner) for more information.
2829

30+
Use the following code to enable the toolbar option.
2931

3032
{% tabs %}
3133
{% highlight js tabtitle="Standalone" %}
3234

33-
3435
var pdfviewer = new ej.pdfviewer.PdfViewer({
3536
documentPath: "https://cdn.syncfusion.com/content/pdf/form-designer.pdf",
3637
enableFormDesignerToolbar: true
@@ -52,6 +53,41 @@ pdfviewer.appendTo('#PdfViewer');
5253
{% endhighlight %}
5354
{% endtabs %}
5455

56+
## Show or hide form designer toolbar on initial load
57+
58+
Open or close the form designer toolbar when the PDF document is loaded initially in the PDF Viewer control. Use the `isFormDesignerToolbarVisible` property to get or set the annotation toolbar visible status. The default value is false. You can refer to [isFormDesignerToolbarVisible API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#isformdesignertoolbarvisible) for more information.
59+
60+
Use the following code to enable or disable the form desinger toolbar on load:
61+
62+
```js
63+
// Inject required modules
64+
ej.pdfviewer.PdfViewer.Inject(
65+
ej.pdfviewer.Toolbar,
66+
ej.pdfviewer.Magnification,
67+
ej.pdfviewer.Navigation,
68+
ej.pdfviewer.LinkAnnotation,
69+
ej.pdfviewer.ThumbnailView,
70+
ej.pdfviewer.BookmarkView,
71+
ej.pdfviewer.TextSelection,
72+
ej.pdfviewer.TextSearch,
73+
ej.pdfviewer.Print,
74+
ej.pdfviewer.Annotation,
75+
ej.pdfviewer.FormFields,
76+
ej.pdfviewer.FormDesigner
77+
);
78+
79+
// Initialize the PDF Viewer
80+
var viewer = new ej.pdfviewer.PdfViewer({
81+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib',
82+
documentPath: 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf',
83+
isFormDesignerToolbarVisible: true // Shows the Form Designer toolbar
84+
});
85+
86+
// Render the viewer
87+
viewer.appendTo('#pdfViewer');
88+
```
89+
90+
5591
## Add the form field dynamically
5692

5793
Click the Form Field icon on the toolbar, then click on the PDF to draw a form field. See the following GIF for reference.

Document-Processing/PDF/PDF-Viewer/javascript-es5/interaction-mode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ domainurl: ##DomainURL##
1010

1111
# Interaction mode in Javascript PDF Viewer control
1212

13-
The PDF Viewer provides interaction mode for easy interaction with the loaded PDF document. Selection mode and panning mode are the two interactions modes.
13+
The PDF Viewer provides interaction mode for easy interaction with the loaded PDF document. Selection mode and panning mode are the two interactions modes. You can refer to [interactionMode API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#interactionmode) for more information.
1414

1515
## Selection mode
1616

Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/bookmark.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ document.getElementById('getBookmarks').addEventListener('click', () => {
8080
});
8181
```
8282

83+
## Show or hide the bookmark panel on load
84+
85+
The `isBookmarkPanelOpen` property gets or sets a boolean value to show or hide the bookmark panel while loading a document. Defaults to false. You can refer to [isBookmarkPanelOpen API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#isbookmarkpanelopen) for mor Details
86+
87+
```js
88+
viewer.isBookmarkPanelOpen = true;
89+
```
90+
8391
## See also
8492

8593
* [Toolbar items](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/toolbar)

Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page-thumbnail.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ pdfviewer.appendTo('#PdfViewer');
4747

4848
![Alt text](../images/thumbnail.png)
4949

50+
## Enable or disable thumbnail view on load
51+
52+
The `enableThumbnail` property gets or sets a boolean value to enable or disable the thumbnail view in PDF Viewer while loading a document. Defaults to true. You can refer to [enableThumbnail API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablethumbnail) for more information.
53+
54+
```js
55+
viewer.enableThumbnail = false;
56+
```
57+
## Show or hide thumbnail view panel on load
58+
59+
The `isThumbnailViewOpen` property gets or sets a boolean value to show or hide the thumbnail view while loading a document. Defaults to false. You can refer to [isThumbnailViewOpen API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#isthumbnailviewopen) for more information.
60+
61+
```js
62+
viewer.isThumbnailViewOpen = true;
63+
```
5064

5165
## See also
5266

Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,22 @@ viewer.navigation.goToPreviousPage();
175175

176176
Find the sample [here](https://stackblitz.com/edit/kpzmjpf7?file=index.js) to perform the page navigation options programmatically.
177177

178+
## Enable or disable navigation module and toolbar on load
179+
180+
The `enableNavigation` property gets or sets a boolean value to enable or disable the page navigation of PDF Viewer while loading a document. Defaults to true. You can refer to [enableNavigation API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablenavigation ) for more information.
181+
182+
```js
183+
// Enable or disable page navigation
184+
viewer.enableNavigation = true;
185+
```
186+
187+
The `enableNavigationToolbar` property gets or sets a boolean value to enable or disable the navigation toolbar of PDF Viewer while loading a document. Defaults to true. You can refer to [enableNavigationToolbar API documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablenavigationtoolbar) for more information.
188+
189+
```js
190+
// Enable or disable navigation toolbar
191+
viewer.enableNavigationToolbar = true;
192+
```
193+
178194
## See also
179195

180196
* [Toolbar items](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/toolbar)

Document-Processing/PDF/PDF-Viewer/javascript-es5/magnification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ domainurl: ##DomainURL##
1010

1111
# Magnification in JavaScript PDF Viewer
1212

13-
The PDF Viewer includes magnification tools in the default toolbar: Zoom In, Zoom Out, Zoom (to a specific value), Fit to Page, and Fit to Width. The toolbar can be configured to show or hide these tools.
13+
The PDF Viewer includes magnification tools in the default toolbar: Zoom In, Zoom Out, Zoom (to a specific value), Fit to Page, and Fit to Width. The toolbar can be configured to show or hide these tools. You can refer to [enableMagnification API Documention](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablemagnification) for more information.
1414

1515
Use the following configuration to enable magnification in the PDF Viewer:
1616

Document-Processing/PDF/PDF-Viewer/javascript-es5/navigation.md

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

1313
The JavaScript PDF Viewer supports multiple navigation options, including toolbar controls, programmatic commands, bookmarks, thumbnails, hyperlinks, and table of contents.
1414

15+
## Enable or disable navigation features
16+
17+
The following properties allow you to toggle navigation:
18+
19+
**enableNavigation** (boolean)
20+
Enables or disables the Navigation module of PDF Viewer. Defaults to true. [API reference](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablenavigation)
21+
```js
22+
// Enable or disable navigation
23+
viewer.enableNavigation = false;
24+
```
25+
26+
**enableNavigationToolbar** (boolean)
27+
Enables or disables the Navigation toolbar of PDF Viewer. Defaults to true. [API reference](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enablenavigationtoolbar)
28+
```js
29+
// Enable or disable navigation toolbar
30+
viewer.enableNavigationToolbar = true;
31+
```
32+
1533
## Toolbar page navigation option
1634

1735
The default toolbar includes the following navigation options:

Document-Processing/PDF/PDF-Viewer/javascript-es5/print.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ domainurl: ##DomainURL##
99
---
1010
# Print in JavaScript PDF Viewer
1111

12-
The Syncfusion JavaScript PDF Viewer component lets users print a loaded PDF document through the built-in toolbar or programmatic calls. Control whether printing is available by setting the `enablePrint` property.
12+
The PDF Viewer supports printing the loaded PDF file.
1313

14-
The following HTML and JavaScript examples render the PDF Viewer with printing enabled in standalone and server-backed applications.
14+
## Enable or disable print option.
15+
16+
The `enablePrint` property enables or disables the print option of the PDF Viewer. The default value is `true`. For more details, see the [enablePrint](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableprint) API documentation.
17+
18+
```js
19+
// Enable or disable print.
20+
viewer.enablePrint = false;
21+
```
22+
23+
You can enable/disable the print using the following code snippet.
1524

1625
```html
1726
{% raw %}
@@ -142,7 +151,9 @@ pdfviewer.appendTo('#PdfViewer');
142151

143152
## Enable print rotation in the PDF Viewer
144153

145-
Set the `enablePrintRotation` property to control whether landscape pages are rotated automatically to fit the paper orientation. Keep it enabled to minimize clipping, or disable it to preserve the original orientation.
154+
The `EnablePrintRotation` property controls whether landscape pages are auto-rotated to best fit when printing. The default value is `true`. Set to `false` to preserve the original page orientation and suppress automatic rotation during print. You can refer to [EnablePrintRotation API Documentation](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#enableprintrotation) for more information.
155+
156+
You can enable/disable the print rotation using the following code snippet.
146157

147158
{% tabs %}
148159
{% highlight js tabtitle="Standalone" %}

0 commit comments

Comments
 (0)