We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can't set RadioButtonOptionField Border properties: System.NotImplementedException

I am using Aspose.PDF v19.1.0.0 for .NET. I am trying to create a RadioButtonOptionField with a border that has a specific Border.Style and Border.Width. I can create the field. I can create an Aspose.Pdf.Annotations.Border object for the field’s border. When I try to set the value for any property of the Border object, I get an error message “Object reference not set to an instance of an object.” I can see that the following properties are returning a System.NotImplementedException error:

  • HCornerRadius
  • VCornerRadius
  • VCornerRaduis

The API reference indicates that these properties can be get and set.

Here is a snippet of my code:

Aspose.Pdf.Annotations.Border newBorder = new 
newBorder.Dash = sourceRBO.Border.Dash;
newBorder.Effect = sourceRBO.Border.Effect;
newBorder.EffectIntensity = sourceRBO.Border.EffectIntensity;
newBorder.Style = sourceRBO.Border.Style;
newBorder.Width = sourceRBO.Border.Width;

Is there a bug in this Aspose.PDF functionality? If so, is there a workaround?

Am I setting the Border incorrectly? If so, please advise how to do it properly.


Thanks for contacting support.

Correct sequence to add border for RadioButtonField is as follows:

RadioButtonField rf = new RadioButtonField(pdfPage);
rf.PartialName = "GroupedRadio";

RadioButtonOptionField option = new RadioButtonOptionField();
option.OptionName = "Yes";
option.Width = 15;
option.Height = 15;
option.Caption = new TextFragment("Yes");
rf.MappingName = "1";
option.Border = new Border(option);
option.Border.Dash = new Dash(1, 3);
option.Border.Effect = BorderEffect.Cloudy;
option.Border.EffectIntensity = 1;
option.Border.Style = BorderStyle.Dashed;
option.Width = 2;

You may please compare your code with above snippet and try using similar sequence to set border. In case you still face any issue, please share your complete sample code snippet with us. We will test the scenario in our environment and address it accordingly.

Thank you for your reply, which solved my issue. The key was to add the RadioButtonOptionField to the RadioButtonField before adding the Border to the RadioButtonOptionField. I had been adding the Border to the option first, and later adding the option to the field.


Thanks for your feedback.

It is good to know that your issue has been resolved. Please keep using our API and in case of any further assistance, please feel free to contact us.