PDF editable Forms using Syncfusion Essential JS 1 MVC

I had an issue while using date picker and radio button in PDF editable form using syncfusion essential JS 1. So I searched for syntax (Properties and usage) but I could not found it. Please, provide solution (how to use radio button and date picker in editable PDF form). Kindly, do the needful. 

25 Replies

KC Karthikeyan Chandrasekar Syncfusion Team July 25, 2018 02:52 PM UTC

Hi Sivasankari, 
Thank you for your interest in Syncfusion Products. 
Could you please provide us more information about your requirement. Are you trying to create a PDF document with the form fields in ASP.NET MVC with EJ-1 platform. Essential PDF is a server side component for generating PDF documents and is supported in MVC. Please refer the below documentation link to include the Date Picker and Radio button in the PDF document. 

If our understanding is different from your requirement, please provide us more information. So that we could serve you better. 
Regards, 
Karthikeyan 



SA sivasankari A July 26, 2018 09:44 AM UTC

Thanks for the reply. By using syncfusion essential JS 1 MVC I had created dynamic pdf form with editable option. In that, I had used normal pdfDocument as given in following link: https://mvc.syncfusion.com/demos/web/pdf/default.
So I didn't used PdfXfaDocument. Now, please provide me solution how to use dateTime in pdfDocument, not in PdfXfaDocument.


KC Karthikeyan Chandrasekar Syncfusion Team July 26, 2018 10:49 AM UTC

Hi Sivasankari, 
In the Acroform you can include the Date Picker with the TextBox. Please find the below code snippet to achieve your requirement. 

PdfDocument document = new PdfDocument(); 
 
PdfPage page = document.Pages.Add(); 
 
PdfTextBoxField field = new PdfTextBoxField(page, "datePick"); 
field.Bounds = new RectangleF(10, 10, 100, 20); 
 
field.Actions.KeyPressed=new PdfJavaScriptAction("AFDate_KeystrokeEx(\"m/d/yy\")"); 
 
field.Actions.Format = new PdfJavaScriptAction("AFDate_FormatEx(\"m/d/yy\")"); 
 
document.Form.Fields.Add(field); 
 
document.Save("Output.pdf"); 
 
document.Close(true); 
Regards, 
Karthikeyan 



SA sivasankari A July 26, 2018 02:33 PM UTC

Thank you for the reply, I had also done the same thing without javascript action.
Now, after entered the data's in editable PDF..I need to get the all input control values from the current PDF form(not already loaded PDF). how to do it?? and also need to download the PDF with data's.

sample code I had used:
                    textBoxField2[index] = new PdfTextBoxField(pdfDoc.Pages[1], individualControls.Header);
                    textBoxField2[index].ToolTip = individualControls.Header;
                    PdfTrueTypeFont font1 = new PdfTrueTypeFont(f);
                    textBoxField2[index].Font = font1;
                    textBoxField2[index].BorderColor = new PdfColor(Color.Gray);
                    textBoxField2[index].BorderStyle = PdfBorderStyle.Beveled;
                    textBoxField2[index].Bounds = bounds;
                    pdfDoc.Form.Fields.Add(textBoxField2[index]);


In the above sample how to get the input control values... because I need to save the values in DB.
I had searched a lot ..but only minimum content is available in the documents.. so kindly, do the needful. 


SA sivasankari A July 27, 2018 04:37 AM UTC

Kindly, provide me a solution.. I am in hurry.....


KC Karthikeyan Chandrasekar Syncfusion Team July 27, 2018 05:03 AM UTC

Hi Sivasankari, 
Could you provide more clear details about your requirement. Upon our understanding I have provided the code snippet below. 
  1. If your requirement is to create a new PDF document with the filled TextBox field and to save the filled PDF in DB, refer the below code snippet.
textBoxField2[index] = new PdfTextBoxField(pdfDoc.Pages[1], individualControls.Header); 
textBoxField2[index].ToolTip = individualControls.Header; 
PdfTrueTypeFont font1 = new PdfTrueTypeFont(f); 
textBoxField2[index].Font = font1; 
textBoxField2[index].BorderColor = new PdfColor(Color.Gray); 
textBoxField2[index].BorderStyle = PdfBorderStyle.Beveled; 
textBoxField2[index].Bounds = bounds; 
pdfDoc.Form.Fields.Add(textBoxField2[index]); 
 
// fill the Text Box value 
textBoxField2[index].Text = "Dummy Name"; 
 
// get the form field values from the Text Box 
string text = textBoxField2[index].Text; 
 
//Save the document. 
MemoryStream ms = new MemoryStream(); 
document.Save(ms); 
document.Close(true); 
// your code to save the PDF document(ms) to the DB 
 
  1. If your requirement is to fill the form fields in the existing PDF document, use the below code snippet.
PdfLoadedDocument ldDoc = new PdfLoadedDocument("Form.pdf"); 
 
// get the value from the Text Box 
var test = (ldDoc.Form.Fields[0] as PdfLoadedTextBoxField).Text; 
 
MemoryStream ms = new MemoryStream(); 
ldDoc.Save(ms); 
ldDoc.Close(true); 
// your code to save the PDF document(ms) to the DB 
 
If our understanding is different from your requirement, please provide us more details so that we could serve you better. 
Regards, 
Karthikeyan 



SA sivasankari A July 27, 2018 01:38 PM UTC

Hi 

My Requirement is generate a editable pdf and show it to the client. Once the client enters the data in the input controls in the browser's pdf viewer. Once he presses submit button in the pdf. the controls's values need to be transferred to the server side in my case it is a mvc action method. I want to receive the submitted data in the FormCollections. Below is my code snippet. this is how i added the submit action and passed the pdf to the client browser.

            PdfSubmitAction submitAction = new PdfSubmitAction("http://localhost:54898/Pdf/PdfSubmit");
            submitAction.HttpMethod = HttpMethod.Post;
            submitAction.IncludeNoValueFields = true;
            submitAction.DataFormat = SubmitDataFormat.Html;
            submitButton1.Actions.GotFocus = submitAction;


           public string PdfSubmit(FormCollection formcollection)
             {
                 // My logic to save the data from form collection extraction into DB model.
             }

once the user presses submit button. I am able to get the callback to the PdfSubmit action method in the server side but when i check the FormCollections. It dosen't have any of the control's values. This is the issue i am facing. Hope you can understand. Kindly do the needful.





KC Karthikeyan Chandrasekar Syncfusion Team July 30, 2018 12:15 PM UTC

Hi Sivasankari, 
Please find the below code snippet to achieve your requirement for sending the form data with Submit Action. 

Form Field 
PdfDocument document = new PdfDocument(); 
PdfPage page = document.Pages.Add(); 
 
PdfTextBoxField textBoxField = new PdfTextBoxField(page, "Name"); 
textBoxField.Bounds = new RectangleF(0, 0, 100, 20); 
textBoxField.ToolTip = "First Name"; 
textBoxField.Text = "Hello"; 
document.Form.Fields.Add(textBoxField); 
 
PdfButtonField submitButton = new PdfButtonField(page, "Submit data"); 
submitButton.Bounds = new RectangleF(100, 60, 50, 20); 
submitButton.ToolTip = "Submit"; 
document.Form.Fields.Add(submitButton); 
 
PdfSubmitAction submitAction = new PdfSubmitAction("http://localhost:62249/api/Values"); 
submitAction.DataFormat = SubmitDataFormat.Html; 
submitButton.Actions.GotFocus = submitAction; 
 
document.Save("Output.pdf"); 
document.Close(true); 

Controller 
public string PdfSubmit(FormCollection person) 
{ 
    // My logic to save the data from form collection extraction into DB model. 
} 

Model 
public class FormCollection 
{ 
    public string Name { get; set; } 
} 

Regards, 
Karthikeyan 



SA sivasankari A July 31, 2018 09:14 AM UTC

Thanks for the reply,
your code: 
PdfDocument document = new PdfDocument(); 
PdfPage page = document.Pages.Add(); 
 
PdfTextBoxField textBoxField = new PdfTextBoxField(page, "Name"); 
textBoxField.Bounds = new RectangleF(0, 0, 100, 20); 
textBoxField.ToolTip = "First Name"; 
textBoxField.Text = "Hello"; 
document.Form.Fields.Add(textBoxField); 
 
PdfButtonField submitButton = new PdfButtonField(page, "Submit data"); 
submitButton.Bounds = new RectangleF(100, 60, 50, 20); 
submitButton.ToolTip = "Submit"; 
document.Form.Fields.Add(submitButton); 
 
PdfSubmitAction submitAction = newPdfSubmitAction("http://localhost:62249/api/Values"); 
submitAction.DataFormat = SubmitDataFormat.Html; 
submitButton.Actions.GotFocus = submitAction; 
 
document.Save("Output.pdf"); 
document.Close(true); 

I had 2 queries:

query 1: 

I am rendered the input controls to pdf as dynamically as following code:

   textBoxField1[index] = new PdfTextBoxField(pdfDoc.Pages[0], individualControls.Header);
                    textBoxField1[index].ToolTip = individualControls.Header;
                    PdfTrueTypeFont font1 = new PdfTrueTypeFont(f);
                    textBoxField1[index].Font = font1;
                    textBoxField1[index].BorderColor = new PdfColor(Color.Gray);
                    textBoxField1[index].BorderStyle = PdfBorderStyle.Beveled;
                    textBoxField1[index].Bounds = bounds;
                    pdfDoc.Form.Fields.Add(textBoxField1[index]);

I want user to enter the data so I didn't use like textBoxField.Text = "Hello"
Now, I need to get the input control values at the time of submit action, HOW TO DO THIS??

query 2:
In the above code you are using pdf action method as follows:

PdfSubmitAction submitAction = new PdfSubmitAction("http://localhost:62249/api/Values"); 

After made a call to the post method how to get the input control values? HOW TO DO THIS??

 [HttpPost]
public ActionResult Values( // WHAT PARAMETER NEED TO PASS ??)
{
     // HOW TO GET THE INPUT CONTROLS VALUE ??
}


Kindly, Provide me the solution.... I m in hurry..
Thank you.


SA sivasankari A July 31, 2018 02:47 PM UTC

Hi,

Greetings. 

I had gone through the sample which is posted in Syncfusion website. In that sample also, after clicking the submit form, input control values are not taken. Kindly, refer the following code:

Code:
   NameValueCollection nvc = HttpUtility.ParseQueryString(Request.Form);
            FirstName.Text = nvc["FirstName"];
            LaseName.Text = nvc["LastName"];                                                 // NOT TAKEN THE INPUT CONTROL VALUES
            Email.Text = nvc["Email"];
            PhNo.Text = nvc["PhNo"];

------------End---------------

I had tried to get the input control values from the PDF form using StreamReader.   But I get a output as following format.

Code:
  using (StreamReader reader = new StreamReader(Request.InputStream))
            {
                input = reader.ReadToEnd();
          }


Output Format: 
<</FDF<</F<</F(http///localhost/51912/Default.aspx)/Type/Filespec/UF(http///localhost/51912/Default.aspx)>>/Fields[<</T(FirstName)/V(hjkhj)>><</T(LastName)/V(jkh)>><</T(Email)/V(jk)>><</T(PhNo)>>]>>>>

Kindly, tell me how to taken the values from above format or else tell me how to get the values??? 
Kindly, provide the solution as soon as possible.

Thank you.




KC Karthikeyan Chandrasekar Syncfusion Team August 1, 2018 07:19 AM UTC

Hi Sivasankari, 
  1. This code (textBoxField.Text = "Hello") is not mandatory, as it is used to fill the default value. You can remove this code snippet it is not required for your requirement.
  2. In the Controller POST method you have to create a Model class as mentioned in our previous update (FormCollection) to get the values from Submit Action. In your case you have to create a Model with the properties individualControls.Header.
I have attached a working sample for your reference below. 
Regards, 
Karthikeyan 



SA sivasankari A August 1, 2018 10:43 AM UTC

Hi,

Thanks, for the reply.
I had put the debugger inside PersonController as following method.

Code:

   //public ActionResult Index(PersonModel person)  // NULL VALUES ONLY CAME
        //{
        //    string Name = person.Name;
        //    string Email = person.Email;
        //    string PhNo = person.PhNo;

        //    return View();
        //}

I requested you to check it. Kindly, provide me the solution.


KC Karthikeyan Chandrasekar Syncfusion Team August 1, 2018 11:29 AM UTC

Hi Sivasankari, 
I guess you opened the PDF in Chrome and tested submitting the form. Can you open the PDF document in Adobe Acrobat or IE and try submitting the form, it will work as expected. 

Regards, 
Karthikeyan 



SA sivasankari A August 2, 2018 10:29 AM UTC

Thank you, YES NOW WORKING FINE.

I had another query, Now I need to get the values along with input control type. For EG:  [values, input control type] =>   ["abc", text box ], ["abcv",drop down] etc... 
It is possible to do it???



KC Karthikeyan Chandrasekar Syncfusion Team August 3, 2018 12:09 PM UTC

Hi Sivasankari, 
No, it is not possible to get the control type during the Submit Action. This is not supported in the PDF specification itself, so we could not provide any solution for this. 

Regards, 
Karthikeyan 



SA sivasankari A August 6, 2018 02:15 PM UTC

Thank you for your reply,
Let me know that how to render the default value for combo box and radio button at the time of PDF creation like Textbox [textbox.Text = "abc"].... I am not loading the PDF document so I didn't use the PdfLoadedDocument . Kindly, Provide me the solution


KC Karthikeyan Chandrasekar Syncfusion Team August 7, 2018 04:40 AM UTC

Hi Sivasankari, 
Following the below UG links you may use the mentioned code snippet to select the values by default. 
ComboBox 
comboBoxField.SelectedIndex = 0; 
 
Radio Button 
employeesRadioList.SelectedIndex = 0; 

Regards, 
Karthikeyan 



SA sivasankari A August 7, 2018 07:56 AM UTC

Hi,
how do I define the date format in a dropdownedit. Getting the error:Uncaught TypeError: Cannot create property 'currency' on string 'yMd'

Controller:

ate=DateTime.Now.ToString("dd/MM/yyyy"),Code="Platina",Description="platina2",Group="ct02",Value=20.42,Unit="Percentagem",Day=false,Month=false,Year=true,Vat=false},
newBusinessConfiguration(){Id=7,Date=DateTime.Now.ToString("dd/MM/yyyy"),Code="Ouro",Description="ourogrosso",Group="ct01",Value=34.90,Unit="Unidade",Day=false,Month=true,Year=false,Vat=false},
newBusinessConfiguration(){Id=8,Date=DateTime.Now.ToString("dd/MM/yyyy"),Code="Ouro",Description="ourofino",Group="ct01",Value=34.32,Unit="Euro",Day=false,Month=false,Year=true,Vat=false},
newBusinessConfiguration(){Id=9,Date=DateTime.Now.ToString("dd/MM/yyyy"),Code="Ouro",Description="ourogrosso",Group="ct01",Value=34.90,Unit="Euro",Day=false,Month=true,Year=false,Vat=false},
newBusinessConfiguration(){Id=10,Date=DateTime.Now.ToString("dd/MM/yyyy"),Code="Prata",Description="Prata950",Group="ct03",Value=0.39,Unit="Unidade",Day=true,Month=false,Year=false,Vat=true},
newBusinessConfiguration(){Id=11,Date=DateTime.Now.ToString("dd/MM/yyyy"),Code="Prata",Description="Prata925",Group="ct03",Value=0.37,Unit="Euro",Day=true,Month=false,Year=false,Vat=false},
};
 
ViewBag.GridNegocios=Gridname(dataSource);
 
 
returnView();
}
 
publicHtmlStringGridname(List<BusinessConfiguration>dataSource)
{
objectregex=new{required=true};
ViewBag.dropdown=DropDownData.GetAllRecords();
 
//DropDownConfiguration[]dropdown=newDropDownConfiguration[]
//{
//newDropDownConfiguration(){Value="one",Text="one"},
//newDropDownConfiguration(){Value="two",Text="one"},
//newDropDownConfiguration(){Value="three",Text="one"},
//newDropDownConfiguration(){Value="test",Text="test"},
//};

List<GridColumn>lstColumns=newList<GridColumn>()
{
 
newGridColumn(){Field="Id",HeaderText="Id",IsPrimaryKey=true,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Right,Visible=false},
newGridColumn(){Field="Date",HeaderText="Data",EditType="datepickeredit",Format="yMd",ValidationRules=regex,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Right,Width="150"},
newGridColumn(){Field="Code",HeaderText="Código",ValidationRules=regex,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Left,Width="70"},
newGridColumn(){Field="Description",HeaderText="Descrição",ValidationRules=regex,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Left,Width="150"},
newGridColumn(){Field="Group",HeaderText="Grupo",ValidationRules=regex,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Left,Width="60"},
newGridColumn(){Field="Value",HeaderText="Valor",EditType="numericedit",ValidationRules=regex,TextAlign=Syncfusion.EJ2.Grids.TextAlign.Right,Width="60"},
newGridColumn(){Field="Unit",HeaderText="Unidade",EditType="dropdownedit",Edit=(new{@params=new{value="one",fields=new{text="ShipName",value="ShipName"},[email protected]}}),TextAlign=Syncfusion.EJ2.Grids.TextAlign.Right,Width="70"},
newGridColumn(){Field="Day",HeaderText="Dia",EditType="booleanedit",DisplayAsCheckBox=true,Width="50"},
newGridColumn(){Field="Month",HeaderText="Mês",EditType="booleanedit",DisplayAsCheckBox=true,Width="50"},
newGridColumn(){Field="Year",HeaderText="Ano",EditType="booleanedit",DisplayAsCheckBox=true,Width="50"},
newGridColumn(){Field="Vat",HeaderText="Iva",EditType="booleanedit",DisplayAsCheckBox=true,Width="50"},

 
};

 
 
Common.Toolbarbar=newCommon.Toolbar()
{
Add=true,
Edit=true,
Delete=true,
Update=true,
Cancel=true,
ExcelExport=true,
Click="toolbarClick",
};
 
 
Common.GridFactorybuilder=newCommon.GridFactory()
{
ID="negocios",
DataSource=dataSource,
 
AllowExportExcel=true,
 
AllowPagging=true,
AllowFiltering=true,
AllowSorting=true,
AllowGrouping=true,
 
PageSize=5,
 
AllowEditing=true,
AllowAdding=true,
AllowDeleting=true,
 
ShowConfirmDialog=true,
ShowDeleteConfirmDialog=true,
 
Columns=lstColumns,
Toolbar=bar,
};



KC Karthikeyan Chandrasekar Syncfusion Team August 7, 2018 11:33 AM UTC

Hi Sivasankari, 
All the Syncfusion assemblies which are referred in the project should have the same version. From the error message can you please check if the required assembly “Syncfusion.EJ.Export” is properly referred in you project. 
You may refer the below user guide for more information. 

Regards, 
Karthikeyan  



SA sivasankari A August 9, 2018 05:28 AM UTC

Thanks for the reply, After hosting in IIS...initially I got the following error....

Could not load file or assembly 'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I had checked with assembly file but this "Microsoft.Windows.Design.Extensibility" is not reffered. So I had worked on and tried to install new version for "Microsoft.Windows.Design.Extensibility" via Visual studio 2017 as following:  Right-Click your project -> Add Reference... -> Assemblies -> Search Assemblies: "Extensibility" -> Select "'Microsoft.Windows.Design.Extensibility" -> OK.  But I got the error as following.... Kindly,provide me the solution.

Server Error in '/SynPDF' Application.

Could not load file or assembly 'Microsoft.Windows.Design.Extensibility' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Windows.Design.Extensibility' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Windows.Design.Extensibility' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace: 

[BadImageFormatException: Could not load file or assembly 'Microsoft.Windows.Design.Extensibility' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Windows.Design.Extensibility' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12858938
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +148
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Windows.Design.Extensibility' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12981028
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12820621


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34280

 




KC Karthikeyan Chandrasekar Syncfusion Team August 9, 2018 11:40 AM UTC

Hi Sivasankari,  
As this query is not related to Syncfusion controls we could not help you in this. However, you may create a new MVC sample in Visual Studio and check compare the references which you are missing in the current project.  
 
Regards,  
Karthikeyan  
 



SA sivasankari A August 10, 2018 06:31 AM UTC

Okay, Thank you.
I had tried with default value selection for comboBox as you said like   comboBoxField.SelectedIndex = 0;  but, while debugging it I had got the values.... after PDF created the default value is not rendered.

DEBUGGING CODE:
comboBox[1]
{Syncfusion.Pdf.Interactive.PdfComboBoxField}
    Actions: {Syncfusion.Pdf.Interactive.PdfFieldActions}
    Appearance: {Syncfusion.Pdf.Interactive.PdfAppearance}
    BackColor: {Syncfusion.Pdf.Graphics.PdfColor}
    BorderColor: {Syncfusion.Pdf.Graphics.PdfColor}
    BorderStyle: Solid
    BorderWidth: 1
    Bounds: {X = 175 Y = 101 Width = 150 Height = 16}
    DisableAutoFormat: false
    Editable: false
    Export: true
    Flatten: false
    Font: {Syncfusion.Pdf.Graphics.PdfTrueTypeFont}
    ForeColor: {Syncfusion.Pdf.Graphics.PdfColor}
    Form: {Syncfusion.Pdf.Interactive.PdfForm}
    HighlightMode: Invert
    Items: {Syncfusion.Pdf.Interactive.PdfListFieldItemCollection}
    Location: {X = 175 Y = 101}
    MappingName: ""
    Name: "Test2"
    Page: {Syncfusion.Pdf.PdfPage}
    PdfTag: null
    ReadOnly: false
    Required: false
    SelectedIndex: 0
    SelectedItem: {Syncfusion.Pdf.Interactive.PdfListFieldItem}
    SelectedValue: "12121212"
    Size: {Width = 150 Height = 16}
    TabIndex: 0
    TextAlignment: Left
    ToolTip: "Test2"
    Visibility: Visible
    Visible: true



MY CODE:

 ArrayList dd= new ArrayLsit();
  foreach (var ddOption in individualControls.DDOptions[index])
                    {
                        comboBox[index].Items.Add(new PdfListFieldItem(ddOption, ddOption));
                        dd.Add(ddOption);
                        foreach (string dropDown in dd)
                        {
                            var selectedIndex = dd.IndexOf(dropDown );
                            if (dropDown  == individualControls.Description)  ===> // selected value as same as drop down list
                            {
                                comboBox[index].SelectedIndex = selectedIndex;          // While debugging..... comboBox[1] => I had got above listed values
                                pdfDoc.Form.Fields.Add(comboBox[index]);

                            }
                        }
                    }

Kindly, help me out.....
Thank you....




KC Karthikeyan Chandrasekar Syncfusion Team August 10, 2018 12:16 PM UTC

Hi Sivasankari, 
We are not able to reproduce the issue the SelectedIndex is working fine as expected. I have attached a working sample and the output PDF screenshot for your reference. If you still face the issue, please modify the attached sample and share with us we will analyze it and provide you the solution at the earliest. 
 
Regards, 
Karthikeyan 



SA sivasankari A August 20, 2018 05:23 AM UTC

Thanks for your help... 
Now everything works fine..

Regards,
Sivasankari A


KC Karthikeyan Chandrasekar Syncfusion Team August 20, 2018 05:37 AM UTC

You are welcome. 
-Karthikeyan 


Loader.
Up arrow icon