Namespace: PdfSharp.Pdf.AcroForms
Represents an interactive form (or AcroForm), a collection of fields for gathering information interactively from the user.
public sealed class PdfAcroForm : PdfSharp.Pdf.PdfDictionary, 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 → PdfAcroForm
Implements ICloneable, IEnumerable<KeyValuePair<String, PdfItem>>, IEnumerable
Gets the fields collection (i.e. the root fields) of this of this AcroForm.
To retrieve all fields (including child-fields), use PdfAcroForm.GetAllFields()
public PdfAcroFieldCollection Fields { get; }
Gets the PdfAcroFieldRenderer used to render PdfAcroFields
public PdfAcroFieldRenderer FieldRenderer { 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.
Gets the flattened field-hierarchy of this AcroForm
public IEnumerable<PdfAcroField> GetAllFields()
Gets the PdfResources of this PdfAcroForm or creates a new one if none exist
internal PdfResources GetOrCreateResources()
PdfResources
The PdfResources of this AcroForm
internal void PrepareForSave()
Flattens the AcroForm by rendering Field-contents directly onto the page
internal void Flatten()
Adds a new PdfTextField to the PdfAcroForm
public PdfTextField AddTextField(Action<PdfTextField> configure)
configure
Action<PdfTextField>
A method that receives the new PdfTextField for further customization
PdfTextField
The created and configured PdfTextField
Adds a new PdfCheckBoxField to the PdfAcroForm
public PdfCheckBoxField AddCheckBoxField(Action<PdfCheckBoxField> configure)
configure
Action<PdfCheckBoxField>
A method that receives the new PdfCheckBoxField for further customization
PdfCheckBoxField
The created and configured PdfCheckBoxField
Adds a new PdfRadioButtonField to the PdfAcroForm
public PdfRadioButtonField AddRadioButtonField(Action<PdfRadioButtonField> configure)
configure
Action<PdfRadioButtonField>
A method that receives the new PdfRadioButtonField for further customization
PdfRadioButtonField
The created and configured PdfRadioButtonField
Adds a new PdfComboBoxField to the PdfAcroForm
public PdfComboBoxField AddComboBoxField(Action<PdfComboBoxField> configure)
configure
Action<PdfComboBoxField>
A method that receives the new PdfComboBoxField for further customization
PdfComboBoxField
The created and configured PdfComboBoxField
Adds a new PdfListBoxField to the PdfAcroForm
public PdfListBoxField AddListBoxField(Action<PdfListBoxField> configure)
configure
Action<PdfListBoxField>
A method that receives the new PdfListBoxField for further customization
PdfListBoxField
The created and configured PdfListBoxField
Adds a new PdfPushButtonField to the PdfAcroForm
public PdfPushButtonField AddPushButtonField(Action<PdfPushButtonField> configure)
configure
Action<PdfPushButtonField>
A method that receives the new PdfPushButtonField for further customization
PdfPushButtonField
The created and configured PdfPushButtonField
Adds a new PdfSignatureField to the PdfAcroForm
public PdfSignatureField AddSignatureField(Action<PdfSignatureField> configure)
configure
Action<PdfSignatureField>
A method that receives the new PdfSignatureField for further customization
PdfSignatureField
The created and configured PdfSignatureField
Adds a new PdfGenericField to the PdfAcroForm
Typically used as a container for other fields
public PdfGenericField AddGenericField(Action<PdfGenericField> configure)
configure
Action<PdfGenericField>
A method that receives the new PdfGenericField for further customization
PdfGenericField
The created and configured PdfGenericField