@@ -4,7 +4,7 @@ title: Create Programmatically in EJ2 ASP.NET MVC PDF Viewer | Syncfusion
4
4
description : Learn here all about Create Programmatically in ASP.NET MVC PDF Viewer component of Syncfusion Essential JS 2 and more.
5
5
platform : ej2-asp-core-mvc
6
6
control : Create Programmatically
7
- publishingplatform : ej2-asp-core-mvc
7
+ publishingplatform : # #Platform_Name##
8
8
documentation : ug
9
9
---
10
10
@@ -69,7 +69,7 @@ Using updateFormField method, Form Field can be updated programmatically. We sho
69
69
function documentLoad () {
70
70
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
71
71
viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox" , bounds: { X : 146 , Y : 229 , Width: 150 , Height: 24 } });
72
- viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textfield " , bounds: { X : 300 , Y : 229 , Width: 150 , Height: 24 } });
72
+ viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox " , bounds: { X : 300 , Y : 229 , Width: 150 , Height: 24 } });
73
73
viewer .formDesignerModule .updateFormField (pdfviewer .formFieldCollections [0 ], { backgroundColor: ' red' });
74
74
}
75
75
</script >
@@ -85,7 +85,7 @@ Using updateFormField method, Form Field can be updated programmatically. We sho
85
85
function documentLoad () {
86
86
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
87
87
viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox" , bounds: { X : 146 , Y : 229 , Width: 150 , Height: 24 } });
88
- viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textfield " , bounds: { X : 300 , Y : 229 , Width: 150 , Height: 24 } });
88
+ viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox " , bounds: { X : 300 , Y : 229 , Width: 150 , Height: 24 } });
89
89
viewer .formDesignerModule .updateFormField (pdfviewer .formFieldCollections [0 ], { backgroundColor: ' red' });
90
90
}
91
91
</script >
@@ -107,7 +107,7 @@ Using deleteFormField method, the form field can be deleted programmatically. We
107
107
function documentLoad () {
108
108
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
109
109
viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox" , bounds: { X : 146 , Y : 229 , Width: 150 , Height: 24 } });
110
- viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textfield " , bounds: { X : 300 , Y : 229 , Width: 150 ,Height: 24 } });
110
+ viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox " , bounds: { X : 300 , Y : 229 , Width: 150 ,Height: 24 } });
111
111
viewer .formDesignerModule .deleteFormField (pdfviewer .formFieldCollections [0 ]);
112
112
}
113
113
</script >
@@ -123,7 +123,7 @@ Using deleteFormField method, the form field can be deleted programmatically. We
123
123
function documentLoad () {
124
124
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
125
125
viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox" , bounds: { X : 146 , Y : 229 , Width: 150 , Height: 24 } });
126
- viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textfield " , bounds: { X : 300 , Y : 229 , Width: 150 ,Height: 24 } });
126
+ viewer .formDesignerModule .addFormField (" Textbox" , { name: " Textbox " , bounds: { X : 300 , Y : 229 , Width: 150 ,Height: 24 } });
127
127
viewer .formDesignerModule .deleteFormField (pdfviewer .formFieldCollections [0 ]);
128
128
}
129
129
</script >
@@ -135,7 +135,7 @@ Using deleteFormField method, the form field can be deleted programmatically. We
135
135
136
136
When the download icon is selected on the toolbar, the Form Fields will be saved in the PDF document and this action will not affect the original document. Refer the below GIF for further reference.
137
137
138
- ![ Alt text] ( ../../../ pdfviewer/images/saveformfield.gif )
138
+ ![ Alt text] ( ../../pdfviewer/images/saveformfield.gif )
139
139
140
140
You can invoke download action using following code snippet.
141
141
@@ -175,7 +175,7 @@ You can invoke download action using following code snippet.
175
175
176
176
When the print icon is selected on the toolbar, the PDF document will be printed along with the Form Fields added to the pages and this action will not affect the original document. Refer the below GIF for further reference.
177
177
178
- ![ Alt text] ( ../../../ pdfviewer/images/printformfield.gif )
178
+ ![ Alt text] ( ../../pdfviewer/images/printformfield.gif )
179
179
180
180
You can invoke print action using the following code snippet.,
181
181
@@ -218,7 +218,7 @@ You can invoke print action using the following code snippet.,
218
218
219
219
We can open the already saved PDF document contains Form Fields in it by clicking the open icon in the toolbar. Refer the below GIF for further reference.
220
220
221
- ![ Alt text] ( ../../../ pdfviewer/images/openexistingpdf.gif )
221
+ ![ Alt text] ( ../../pdfviewer/images/openexistingpdf.gif )
222
222
223
223
## Validate form fields
224
224
@@ -234,7 +234,7 @@ Add the following code snippet to validate the form fields,
234
234
</div >
235
235
<script >
236
236
function validateFormFields (args ) {
237
- var nonfilledFormFields = args .nonFillableFields ;
237
+ var non_filledFormFields = args .nonFillableFields ;
238
238
}
239
239
</script >
240
240
@@ -247,7 +247,7 @@ Add the following code snippet to validate the form fields,
247
247
</div >
248
248
<script >
249
249
function validateFormFields (args ) {
250
- var nonfilledFormFields = args .nonFillableFields ;
250
+ var non_filledFormFields = args .nonFillableFields ;
251
251
}
252
252
</script >
253
253
@@ -667,7 +667,7 @@ The following code example explains how to update the properties of the signatur
667
667
668
668
</script >
669
669
670
- ![ Signature Field Settings] ( ../../../ pdfviewer/images/signature_field.png )
670
+ ![ Signature Field Settings] ( ../../pdfviewer/images/signature_field.png )
671
671
672
672
The following code example explains how to update the properties of the initial field added to the document from the form designer toolbar.
673
673
@@ -704,7 +704,7 @@ window.onload = function () {
704
704
705
705
</script >
706
706
707
- ![ Initial Field Settings] ( ../../../ pdfviewer/images/InitialField.png )
707
+ ![ Initial Field Settings] ( ../../pdfviewer/images/InitialField.png )
708
708
709
709
### Textbox field settings
710
710
@@ -840,7 +840,7 @@ window.onload = function () {
840
840
841
841
</script >
842
842
843
- ![ Textbox Field Settings] ( ../../../ pdfviewer/images/Textbox.png )
843
+ ![ Textbox Field Settings] ( ../../pdfviewer/images/Textbox.png )
844
844
845
845
### Password field settings
846
846
@@ -972,7 +972,7 @@ window.onload = function () {
972
972
973
973
</script >
974
974
975
- ![ Password Field Settings] ( ../../../ pdfviewer/images/Password.png )
975
+ ![ Password Field Settings] ( ../../pdfviewer/images/Password.png )
976
976
977
977
### CheckBox field settings
978
978
@@ -1080,7 +1080,7 @@ window.onload = function () {
1080
1080
1081
1081
</script >
1082
1082
1083
- ![ CheckBox Field Settings] ( ../../../ pdfviewer/images/Checkbox.png )
1083
+ ![ CheckBox Field Settings] ( ../../pdfviewer/images/Checkbox.png )
1084
1084
1085
1085
### RadioButton field settings
1086
1086
@@ -1190,7 +1190,7 @@ window.onload = function () {
1190
1190
1191
1191
</script >
1192
1192
1193
- ![ RadioButton Field Settings] ( ../../../ pdfviewer/images/Radiobutton.png )
1193
+ ![ RadioButton Field Settings] ( ../../pdfviewer/images/Radiobutton.png )
1194
1194
1195
1195
### ListBox field settings
1196
1196
@@ -1213,7 +1213,7 @@ The following code example explains how to update the ListBox field properties o
1213
1213
function updateProperties () {
1214
1214
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1215
1215
var formField = viewer .retrieveFormFields ();
1216
- const customOptions = [
1216
+ var customOptions = [
1217
1217
{ itemName: ' item1' , itemValue: ' item1' },
1218
1218
{ itemName: ' item2' , itemValue: ' item2' },
1219
1219
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1255,7 +1255,7 @@ The following code example explains how to update the ListBox field properties o
1255
1255
function updateProperties () {
1256
1256
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1257
1257
var formField = viewer .retrieveFormFields ();
1258
- const customOptions = [
1258
+ var customOptions = [
1259
1259
{ itemName: ' item1' , itemValue: ' item1' },
1260
1260
{ itemName: ' item2' , itemValue: ' item2' },
1261
1261
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1292,7 +1292,7 @@ The following code example explains how to update the properties of the listbox
1292
1292
1293
1293
window .onload = function () {
1294
1294
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1295
- const customOptions = [
1295
+ var customOptions = [
1296
1296
{ itemName: ' item1' , itemValue: ' item1' },
1297
1297
{ itemName: ' item2' , itemValue: ' item2' },
1298
1298
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1335,7 +1335,7 @@ window.onload = function () {
1335
1335
1336
1336
</script >
1337
1337
1338
- ![ ListBox Field Settings] ( ../../../ pdfviewer/images/Listbox.png )
1338
+ ![ ListBox Field Settings] ( ../../pdfviewer/images/Listbox.png )
1339
1339
1340
1340
### DropDown field settings
1341
1341
@@ -1358,7 +1358,7 @@ The following code example explains how to update the DropDown field properties
1358
1358
function updateProperties () {
1359
1359
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1360
1360
var formField = viewer .retrieveFormFields ();
1361
- const customOptions = [
1361
+ var customOptions = [
1362
1362
{ itemName: ' item1' , itemValue: ' item1' },
1363
1363
{ itemName: ' item2' , itemValue: ' item2' },
1364
1364
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1400,7 +1400,7 @@ The following code example explains how to update the DropDown field properties
1400
1400
function updateProperties () {
1401
1401
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1402
1402
var formField = viewer .retrieveFormFields ();
1403
- const customOptions = [
1403
+ var customOptions = [
1404
1404
{ itemName: ' item1' , itemValue: ' item1' },
1405
1405
{ itemName: ' item2' , itemValue: ' item2' },
1406
1406
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1437,7 +1437,7 @@ The following code example explains how to update the properties of the dropdown
1437
1437
1438
1438
window .onload = function () {
1439
1439
var viewer = document .getElementById (' pdfviewer' ).ej2_instances [0 ];
1440
- const customOptions = [
1440
+ var customOptions = [
1441
1441
{ itemName: ' item1' , itemValue: ' item1' },
1442
1442
{ itemName: ' item2' , itemValue: ' item2' },
1443
1443
{ itemName: ' item3' , itemValue: ' item3' }
@@ -1480,4 +1480,4 @@ window.onload = function () {
1480
1480
1481
1481
</script >
1482
1482
1483
- ![ DropDownBox Field Settings] ( ../../../ pdfviewer/images/Dropdown.png )
1483
+ ![ DropDownBox Field Settings] ( ../../pdfviewer/images/Dropdown.png )
0 commit comments