Free Support Forum - aspose.com

Adding items to combobox

Hi,
I am trying to add items to the existing combobox in the pdf document. I am using the below code:
formEditor.AddListItem(“FieldName”, new string[] { “x”, “x” });

I am getting Object Reference Not set to an instance error when executing the above code.

Also I am getting same error when i try to assign URL for the Submit button in the pdf
formEditor.SetSubmitUrl(fieldname,url)

I tried giving full field names too, but still getting the same error. I have attached a sample file. Please go through the issue and let me know the solution as soon as possible. I am using Aspose.Pdf 6.3.0.0 full version.

Thanks,
Ganesh

Ganeshkumarchn:
Hi,
I am trying to add items to the existing combobox in the pdf document. I am using the below code:
formEditor.AddListItem(“FieldName”, new string[] { “x”, “x” });

I am getting Object Reference Not set to an instance error when executing the above code.


Hi Ganesh,

Thanks for using our products and sorry for replying you late. When adding the item to existing form field, please ensure that you are using correct name. Can you please confirm that ComboBox control name is
FieldName. You may consider visiting the following link for information on how to Add List Item in an Existing PDF File (Facades)

Ganeshkumarchn:

Also I am getting same error when i try to assign URL for the Submit button in the pdf
formEditor.SetSubmitUrl(fieldname,url)

I tried giving full field names too, but still getting the same error. I have attached a sample file. Please go through the issue and let me know the solution as soon as possible. I am using Aspose.Pdf 6.3.0.0 full version.


Please notice my reply over 335873. We are really sorry for your inconvenience.

Hi,
FieldName is just an example…you can use any of the dropdown ids in the pdf.
ex: PositionType