Class PdfForm
public sealed class PdfForm : PdfObject, IDisposable
- Inheritance
-
PdfForm
- Implements
- Inherited Members
Properties
Document
public PdfDocument Document { get; }
Property Value
FormFillInfo
public PdfFormFillInfo FormFillInfo { get; }
Property Value
Methods
CreateCheckBox(PdfPage, string, FsRectF)
public PdfCheckBox CreateCheckBox(PdfPage page, string name, FsRectF bounds)
Parameters
Returns
CreatePushButton(PdfPage, string, FsRectF)
public PdfPushButton CreatePushButton(PdfPage page, string name, FsRectF bounds)
Parameters
Returns
CreateRadioButton(PdfPage, string, FsRectF)
public PdfRadioButton CreateRadioButton(PdfPage page, string name, FsRectF bounds)
Parameters
Returns
CreateRadioGroup(PdfPage, string, FsRectF[], string[])
public List<PdfRadioButton> CreateRadioGroup(PdfPage page, string name, FsRectF[] bounds, string[] exportValues)
Parameters
Returns
CreateTextField(PdfPage, string, FsRectF)
public PdfTextField CreateTextField(PdfPage page, string name, FsRectF bounds)
Parameters
Returns
Dispose(bool)
Releases the resources used by the current instance of the class.
protected override void Dispose(bool disposing)
Parameters
disposing
boolAre we disposing managed objects?
Remarks
This method should be called when the instance is no longer needed to free unmanaged resources. It ensures that any associated native resources are properly released based on the type of the object.
Exceptions
- InvalidOperationException
Thrown if the object type is not supported for disposal.
GetElements(PdfPage)
public IReadOnlyList<PdfFormElement> GetElements(PdfPage page)
Parameters
page
PdfPage
Returns
GetFocusableSubtypeCount()
Gets the number of annotation subtypes considered focusable by the current form environment.
public int GetFocusableSubtypeCount()
Returns
- int
The number of focusable annotation subtypes.
GetFocusableSubtypes()
Retrieves a list of annotation subtypes that are considered focusable within this form context.
public List<PdfAnnotationSubtype> GetFocusableSubtypes()
Returns
- List<PdfAnnotationSubtype>
A list of supported focusable annotation subtypes.
GetFormFieldAlternateName(PdfAnnotation)
Retrieves the alternate name of a form field associated with the specified PDF annotation.
public string? GetFormFieldAlternateName(PdfAnnotation annotation)
Parameters
annotation
PdfAnnotationThe PDF annotation for which to retrieve the form field's alternate name. Cannot be null.
Returns
- string
The alternate name of the form field as a string, or null if the form field does not have an alternate name.
Remarks
The alternate name of a form field is an optional, user-friendly name that may be used in place of the field's technical name.
Exceptions
- ArgumentNullException
Thrown if
annotation
is null.
GetFormFieldAtPoint(PdfPage, float, float)
public PdfAnnotation? GetFormFieldAtPoint(PdfPage page, float x, float y)
Parameters
Returns
GetFormFieldName(PdfAnnotation)
Retrieves the form field name associated with the specified PDF annotation.
public string? GetFormFieldName(PdfAnnotation annot)
Parameters
annot
PdfAnnotationThe PdfAnnotation object representing the annotation to retrieve the form field name for. Must not be null.
Returns
- string
The name of the form field as a string, or null if the annotation is not a widget annotation or if the form field name cannot be determined.
Exceptions
- ArgumentNullException
Thrown if
annot
is null.
SetFocusableSubtypes(IEnumerable<PdfAnnotationSubtype>)
Sets the focusable annotation subtypes for the current PDF annotation.
public bool SetFocusableSubtypes(IEnumerable<PdfAnnotationSubtype> subtypes)
Parameters
subtypes
IEnumerable<PdfAnnotationSubtype>A collection of PdfAnnotationSubtype values representing the annotation subtypes that should be focusable. If the collection is null or empty, no subtypes will be set.
Returns
Remarks
This method allocates unmanaged memory to pass the subtypes to the underlying PDF library. Ensure that the provided subtypes are valid and meaningful for the current context.