Skip to content

Commit 18cc607

Browse files
1004880: Updated API links and aligned code-snippet.
1 parent 17d98e6 commit 18cc607

3 files changed

Lines changed: 61 additions & 36 deletions

File tree

Document-Processing/PDF/PDF-Viewer/javascript-es6/form-designer/form-designer.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ domainurl: ##DomainURL##
1010

1111
# Form Designer in TypeScript PDF Viewer
1212

13-
When `Form Designer mode` is enabled in the Syncfusion `TypeScript PDF Viewer`, a default `Form Designer user interface (UI)` is displayed. This UI includes a built in toolbar for adding form fields such as text boxes, password fields, check boxes, radio buttons, drop down lists, list boxes, and signature and initial fields.
13+
When [Form Designer mode](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesigner) is enabled in the Syncfusion [TypeScript PDF Viewer](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es6/overview), a default [Form Designer user interface (UI)](https://document.syncfusion.com/demos/pdf-viewer/javascript/#/tailwind3/pdfviewer/formdesigner.html) is displayed. This UI includes a built in toolbar for adding form fields such as text boxes, password fields, check boxes, radio buttons, drop down lists, list boxes, and signature and initial fields.
1414

1515
Using the Form Designer UI, users can place form fields on the PDF, move and resize them, configure field and widget properties, preview the designed form, and remove fields when required. The Form Designer toolbar can also be shown or hidden and customized to control the available tools based on application requirements, enabling flexible and interactive form design directly within the viewer.
1616

17-
**Key Features**
17+
## Key Features
1818

1919
**Add Form Fields**
2020
You can add the following form fields to the PDF:
@@ -45,11 +45,14 @@ Designed form fields can be saved into the PDF document and printed with their a
4545

4646
## Enable Form Designer
4747

48-
To enable form design features, inject the `FormDesigner` module into the PDF Viewer. After injecting the module, use the `enableFormDesigner` API to show or hide the Form Designer option in the main toolbar.
48+
To enable form design features, inject the [FormDesigner](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesigner) module into the PDF Viewer. After injecting the module, use the [enableFormDesigner](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#enableformdesigner) API to show or hide the Form Designer option in the main toolbar.
4949

5050
```ts
51-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
52-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
51+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
52+
ThumbnailView, BookmarkView, TextSelection, TextSearch,
53+
FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
54+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
55+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
5356
let pdfviewer: PdfViewer = new PdfViewer();
5457
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
5558
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";
@@ -59,19 +62,17 @@ pdfviewer.appendTo('#PdfViewer');
5962

6063
## Form Designer UI
6164

62-
When `Form Designer mode` is enabled in the Syncfusion `TypeScript PDF Viewer`, a default `Form Designer user interface (UI)` is displayed. This UI provides a built in toolbar for adding common form fields such as text boxes, check boxes, radio buttons, drop down lists, and signature fields. Users can place fields on the PDF, select them, resize or move them, and configure their properties using the available editing options, enabling interactive form creation directly within the viewer.
65+
When [Form Designer mode](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesigner) is enabled in the Syncfusion [TypeScript PDF Viewer](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es6/overview), a default [Form Designer user interface (UI)](https://document.syncfusion.com/demos/pdf-viewer/javascript/#/tailwind3/pdfviewer/formdesigner.html) is displayed. This UI provides a built in toolbar for adding common form fields such as text boxes, check boxes, radio buttons, drop down lists, and signature fields. Users can place fields on the PDF, select them, resize or move them, and configure their properties using the available editing options, enabling interactive form creation directly within the viewer.
6366

6467
![FormDesigner](../images/FormDesigner.gif)
6568

66-
**Preview of the designed PDF form**
67-
68-
![Forms with Filled sample Data](../images/FormFilled.png)
69+
{% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/prefilledforms-cs1" %}
6970

7071
For more information about creating and editing form fields in the PDF Viewer, refer to the [Form Creation in TypeScript PDF Viewer documentation](./Create-edit-Style-del-formFields/create-formfields).
7172

7273
## Form Designer Toolbar
7374

74-
The `Form Designer toolbar` appears at the top of the PDF Viewer and provides quick access to form field creation tools. It includes frequently used field types such as:
75+
The [Form Designer toolbar](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesignertoolbarsettings) appears at the top of the PDF Viewer and provides quick access to form field creation tools. It includes frequently used field types such as:
7576

7677
- [Text box](../form-designer/Create-edit-Style-del-formFields/create-formfields#add-textbox)
7778
- [Password Field](../form-designer/Create-edit-Style-del-formFields/create-formfields#add-password)
@@ -84,16 +85,17 @@ The `Form Designer toolbar` appears at the top of the PDF Viewer and provides qu
8485

8586
Each toolbar item allows users to place the corresponding form field by selecting the tool and clicking on the desired location in the PDF document.
8687

87-
**GIF – Adding a text box field using the Form Designer toolbar**
88-
8988
![Adding Text Box](../images/AddTextBox.gif)
9089

91-
Use the following Code-snippet to enable Form Designer by injecting `FormDesigner` Module.
90+
Use the following Code-snippet to enable Form Designer by injecting [Form Designer mode](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesigner) Module.
9291

9392
```ts
94-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
93+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
94+
ThumbnailView, BookmarkView, TextSelection, TextSearch,
95+
FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
9596

96-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
97+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
98+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
9799

98100
let pdfviewer: PdfViewer = new PdfViewer();
99101
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
@@ -105,7 +107,7 @@ For more information about creating and editing form fields in the PDF Viewer, r
105107

106108
## Show or Hide the Built-in Form Designer Toolbar
107109

108-
You can control the visibility of the Form Designer toolbar using the `isFormDesignerToolbarVisible()` method. This allows you to display or hide the Form Designer tools in the PDF Viewer based on your application requirements.
110+
You can control the visibility of the Form Designer toolbar using the [isFormDesignerToolbarVisible()](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#isformdesignertoolbarvisible) method. This allows you to display or hide the Form Designer tools in the PDF Viewer based on your application requirements.
109111

110112
**Use this method to:**
111113
- Show the Form Designer toolbar when form design is required
@@ -119,8 +121,11 @@ You can control the visibility of the Form Designer toolbar using the `isFormDes
119121
<button id="hideDesignerBtn">Hide Form Designer Toolbar</button>
120122
```
121123
```ts
122-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
123-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
124+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
125+
ThumbnailView, BookmarkView, TextSelection, TextSearch,
126+
FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
127+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
128+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
124129
let pdfviewer: PdfViewer = new PdfViewer();
125130
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
126131
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";
@@ -137,7 +142,7 @@ document.getElementById('hideDesignerBtn')!.onclick = () => {
137142

138143
## Customize the Built-in Form Designer Toolbar
139144

140-
You can customize the Form Designer toolbar by specifying the tools to display and arranging them in the required order using the `FormDesignerToolbarItems` property.
145+
You can customize the Form Designer toolbar by specifying the tools to display and arranging them in the required order using the [FormDesignerToolbarItems](https://ej2.syncfusion.com/documentation/api/pdfviewer/formdesignertoolbaritem) property.
141146

142147
This customization helps you limit the available tools and simplify the user interface.
143148

@@ -146,8 +151,11 @@ This customization helps you limit the available tools and simplify the user int
146151
- Any toolbar items not listed remain hidden, resulting in a cleaner and more focused UI.
147152

148153
```ts
149-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
150-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
154+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
155+
ThumbnailView, BookmarkView, TextSelection, TextSearch,
156+
FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
157+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
158+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
151159
let pdfviewer: PdfViewer = new PdfViewer();
152160
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
153161
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";

Document-Processing/PDF/PDF-Viewer/javascript-es6/form-designer/form-filling.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Syncfusion PDF Viewer supports three types of form-filling:
1414

1515
1. [Filling Form Fields Programmatically](#fill-pdf-forms-programmatically)
1616

17-
You can fill or update PDF form fields programmatically using the updateFormFieldsValue APIs. This approach is useful when form data needs to be set dynamically based on application logic.
17+
You can fill or update PDF form fields programmatically using the [updateFormFieldsValue](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#updateformfieldsvalue) APIs. This approach is useful when form data needs to be set dynamically based on application logic.
1818

1919
2. [Form Filling Through User Interface](#fill-pdf-forms-through-the-user-interface)
2020

@@ -26,17 +26,20 @@ The Syncfusion PDF Viewer supports three types of form-filling:
2626

2727
## Fill PDF forms programmatically
2828

29-
You can update the values of PDF form fields programmatically using the updateFormFieldsValue API. This method allows you to set or modify form field values dynamically based on application logic, without user interaction.
29+
You can update the values of PDF form fields programmatically using the [updateFormFieldsValue](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#updateformfieldsvalue) API. This method allows you to set or modify form field values dynamically based on application logic, without user interaction.
3030

3131
The following example demonstrates how to update PDF form field values programmatically:
3232

3333
```html
3434
<button id="updateBtn">Fill Form Fields</button>
3535
```
3636
```ts
37-
import {PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, Annotation, FormFields} from '@syncfusion/ej2-pdfviewer';
37+
import {PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,
38+
ThumbnailView, BookmarkView, TextSelection,
39+
Annotation, FormFields} from '@syncfusion/ej2-pdfviewer';
3840

39-
PdfViewer.Inject(Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, Annotation, FormFields);
41+
PdfViewer.Inject(Toolbar, Magnification, Navigation, LinkAnnotation,
42+
ThumbnailView, BookmarkView, TextSelection, Annotation, FormFields);
4043

4144
let pdfviewer: PdfViewer = new PdfViewer({
4245
documentPath:
@@ -77,7 +80,7 @@ The PDF Viewer supports common form fields such as text boxes, check boxes, radi
7780

7881
## Fill PDF forms through Import Data
7982

80-
The Syncfusion PDF Viewer allows you to import form field data into an existing PDF document using the `importFormFields` API. This feature enables you to pre-fill form fields using data from an external source without requiring manual user input.
83+
The Syncfusion PDF Viewer allows you to import form field data into an existing PDF document using the [importFormFields](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#importformfields) API. This feature enables you to pre-fill form fields using data from an external source without requiring manual user input.
8184

8285
Imported form field data is automatically mapped to the corresponding form fields in the PDF document based on the field names. Once the data is imported, the populated values are displayed in the PDF Viewer and can be edited through the user interface if required.
8386

@@ -86,9 +89,13 @@ Imported form field data is automatically mapped to the corresponding form field
8689
<div id="pdfViewer" style="height: 640px; width: 100%"></div>
8790
```
8891
```ts
89-
import { PdfViewer, FormFieldDataFormat, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
92+
import { PdfViewer, FormFieldDataFormat, Toolbar, Magnification, Navigation,
93+
Annotation, LinkAnnotation, ThumbnailView, BookmarkView,
94+
TextSelection, FormFields, FormDesigner } from '@syncfusion/ej2-pdfviewer';
9095

91-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, FormFields, FormDesigner);
96+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation,
97+
LinkAnnotation, ThumbnailView, BookmarkView, TextSelection,
98+
FormFields, FormDesigner);
9299

93100
const viewer = new PdfViewer({
94101
documentPath: 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf',
@@ -113,15 +120,19 @@ For more details, see [Export Form Data](./import-export-formfields/export-formf
113120

114121
## How to Validate Form Fields using `validateFormFields` Event
115122

116-
The `validateFormFields` event in the Syncfusion PDF Viewer is triggered when a user tries to download or submit a form while validation is enabled. You can use the `retrieveFormFields()` API to get all the form fields and check them one by one to see if any form fields values are empty.
123+
The [validateFormFields](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#validateformfields) event in the Syncfusion PDF Viewer is triggered when a user tries to download or submit a form while validation is enabled. You can use the [retrieveFormFields()](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#retrieveformfields) API to get all the form fields and check them one by one to see if any form fields values are empty.
117124

118125
This validation applies to all form field types in the PDF Viewer. A textbox is empty if no text is entered, a list box or dropdown is empty if no item is selected, a signature or initial field is empty if the user has not signed, and radio buttons or checkboxes are empty if none are chosen.
119-
By enabling `enableFormFieldsValidation` and wiring the event, you can go through each field and stop the action if required fields are not filled.
126+
By enabling [enableFormFieldsValidation](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#enableformfieldsvalidation) and wiring the event, you can go through each field and stop the action if required fields are not filled.
120127

121128
```ts
122-
import {PdfViewer, Toolbar, Magnification, Navigation,LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, Annotation,FormDesigner, FormFields,TextFieldSettings} from '@syncfusion/ej2-pdfviewer';
129+
import {PdfViewer, Toolbar, Magnification, Navigation,LinkAnnotation,
130+
ThumbnailView, BookmarkView, TextSelection, Annotation,
131+
FormDesigner, FormFields,TextFieldSettings} from '@syncfusion/ej2-pdfviewer';
123132

124-
PdfViewer.Inject(Toolbar, Magnification, Navigation,LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, Annotation,FormDesigner, FormFields);
133+
PdfViewer.Inject(Toolbar, Magnification, Navigation,LinkAnnotation,
134+
ThumbnailView, BookmarkView, TextSelection, Annotation,
135+
FormDesigner, FormFields);
125136

126137
let pdfviewer: PdfViewer = new PdfViewer({
127138
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',

Document-Processing/PDF/PDF-Viewer/javascript-es6/form-designer/overview.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ See the [Filling PDF Forms](./form-filling) page for full details.
2222
Use the following code-snippet to enable form-filling by injecting `FormFields` Module.
2323

2424
```ts
25-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields} from '@syncfusion/ej2-pdfviewer';
26-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields);
25+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
26+
ThumbnailView, BookmarkView, TextSelection,
27+
TextSearch, FormFields} from '@syncfusion/ej2-pdfviewer';
28+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
29+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields);
2730
let pdfviewer: PdfViewer = new PdfViewer();
2831
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
2932
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";
@@ -45,8 +48,11 @@ See the [Form Designer](./form-designer) page for full details.
4548
Use the following Code-snippet to enable Form Designer by injecting `FormDesigner` Module.
4649

4750
```ts
48-
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
49-
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
51+
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
52+
ThumbnailView, BookmarkView, TextSelection, TextSearch,
53+
FormFields, FormDesigner, TextFieldSettings } from '@syncfusion/ej2-pdfviewer';
54+
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
55+
ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
5056
let pdfviewer: PdfViewer = new PdfViewer();
5157
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf";
5258
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib";

0 commit comments

Comments
 (0)