Namespace: PdfSharp.Pdf.AcroForms
Represents the radio button field.
public sealed class PdfRadioButtonField : PdfButtonField, System.ICloneable, System.Collections.Generic.IEnumerable`1[[System.Collections.Generic.KeyValuePair`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[PdfSharp.Pdf.PdfItem, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Collections.IEnumerable
Inheritance Object → PdfItem → PdfObject → PdfDictionary → PdfAcroField → PdfButtonField → PdfRadioButtonField
Implements ICloneable, IEnumerable<KeyValuePair<String, PdfItem>>, IEnumerable
Gets or sets the value of this field. This should be an item from the PdfRadioButtonField.Options list.
Setting this to null or an empty string unchecks all radio-buttons.
public string Value { get; set; }
Gets the option-names of this RadioButton
Use one of these values when setting PdfRadioButtonField.Value
You cannot manipulate this collection directly.
To change the elements you have to manipulate the PdfAcroField.Annotations of this field.
public ReadOnlyCollection<string> Options { get; }
Gets or sets the (optional) export-values for each entry in this radio button group.
If the field does not specify these, is returned.
public ICollection<string> ExportValues { get; set; }
Gets or sets the (zero-based) index of the selected radio button in a radio button group.
Use -1 to deselect all items.
This is an alternative to the PdfRadioButtonField.Value
public int SelectedIndex { get; set; }
Gets the name of this field.
public string Name { get; set; }
Gets the alternative Name of the Field (/TU)
public string AlternateName { get; set; }
Gets the mapping Name of the Field (/TM)
public string MappingName { get; set; }
Gets the fully qualified name of this field, that is: “parent-name.field-name”
If the field has no parent, this is equal to PdfAcroField.Name
public string FullyQualifiedName { get; }
Gets the Parent of this field or null, if the field has no parent
public PdfAcroField Parent { get; internal set; }
Gets the field flags of this instance.
public PdfAcroFieldFlags Flags { get; }
Gets or sets the font used to draw the text of the field.
public XFont Font { get; set; }
Gets the font size that was obtained by analyzing the Fields’ content-stream.
public double DeterminedFontSize { get; internal set; }
Gets or sets the foreground color of the field.
public XColor ForeColor { get; set; }
Gets or sets the value of the field.
public PdfItem Value { get; set; }
Gets or sets the default value of the field.
public PdfItem DefaultValue { get; set; }
Gets or sets the alignment for the text of this field.
public TextAlignment TextAlign { get; set; }
Gets or sets a value indicating whether the field is read only.
public bool ReadOnly { get; set; }
public PdfAcroField Item { get; }
Indicates whether the field has child fields and/or annotations.
public bool HasKids { get; }
Indicates whether the field has child fields.
public bool HasChildFields { get; }
Use GetDescendantNames
Gets the names of all descendants of this field.
public String[] DescendantNames { get; }
Gets the collection of fields within this field.
public PdfAcroFieldCollection Fields { get; }
Gets the annotations for this field. The elements in this list are of type PdfWidgetAnnotation.
public PdfAnnotationArray Annotations { get; }
Gets the dictionary containing the elements of this dictionary.
public DictionaryElements Elements { get; }
Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has no stream. To create the stream, call the CreateStream function.
public PdfStream Stream { get; set; }
Gets the PdfDocument this object belongs to.
public PdfDocument Owner { get; }
Indicates whether the object is an indirect object.
public bool IsIndirect { get; }
Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.
public PdfObjectInternals Internals { get; }
Gets the indirect reference of this object. If the value is null, this object is a direct object.
public PdfReference Reference { get; internal set; }
Gets the indirect reference of this object. Throws if it is null.
public PdfReference ReferenceNotNull { get; }
InvalidOperationException
The indirect reference must be not null here.
Renders the appearance of this field
protected void RenderAppearance()
A special overload for RadioButtons that allows specifying the name for the “On”-State of an individual radio-button
public PdfWidgetAnnotation AddAnnotation(string nameOfOnState, Action<PdfWidgetAnnotation> configure)
nameOfOnState
String
Name of the “On”-State of this RadioButton
configure
Action<PdfWidgetAnnotation>
A method that is used to configure the Annotation
PdfWidgetAnnotation
The created and configured Annotation
internal void PrepareForSave()