SignatureField

SignatureField

Overview

SignatureField is a class in Aspose.PDF FOSS for .NET. Inherits from: Field.

SignatureField.Sign(signature) applies a digital signature to a form field, and Flatten() can make the signature appearance permanent in the document.

This class provides 27 methods for working with SignatureField objects in .NET programs. Available methods include: Accept, ChangeAfterResize, Clone, CopyTo, ExecuteFieldJavaScript, ExportToJson, ExportValueToJson, ExtractCertificate, ExtractCertificateObject, ExtractImage, Field, Flatten, and 12 additional methods. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Action, Actions, ActiveState, Alignment, AlternateName, AnnotationFlags, and 73 more.

Properties

NameTypeAccessDescription
SignedBytesbyte[]?ReadReturns the latest signed bytes, or null when this field hasn’t been signed via Sign(Signature).
SignatureSignature?ReadInformation about the digital signature in this field.
TypeFieldTypeReadThe field type.
FullNamestring?ReadThe fully qualified field name.
Namestring?Read/WriteThe fully qualified field name (alias for FullName).
TextHorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteText-specific horizontal alignment override applied to the field’s widget appearance.
PageIndexintRead1-based index of the page that owns this field’s widget.
PartialNamestring?Read/WriteThe partial field name (/T).
NormalAppearanceXForm?ReadThe field’s “Normal” appearance (the /AP /N entry).
AppearanceAspose.Pdf.Annotations.AppearanceDictionaryReadThe field widget’s appearance streams (the /AP entry), keyed by appearance name.
OnActivatedAnnotations.PdfAction?Read/WriteThe action triggered when this field is activated (/A entry).
Valuestring?Read/WriteThe field value (/V).
CountintReadNumber of kids in this field’s /Kids array — either child fields (hierarchy nodes) or widget annotations (a terminal field with multiple visual widgets, such as a grouped checkbox/radio).
FieldsField[]ReadField-typed child kids of this field as a snapshot array — convenience accessor mirroring Fields on the form.
DefaultValuestring?ReadThe default value (/DV).
AlternateNamestring?Read/WriteThe alternate field name / tooltip (/TU entry).
FlagsAspose.Pdf.Annotations.AnnotationFlagsRead/WriteThe widget annotation flags (/F entry), e.g.
TabOrderintRead/WriteTab order index for this field.
IsReadOnlyboolReadWhether the field is read-only.
ReadOnlyboolRead/WriteWhether the field is read-only (settable alias for API parity).
IsRequiredboolReadWhether the field is required.
CharacteristicsAspose.Pdf.Annotations.CharacteristicsReadAppearance characteristics (border / background colors, widget rotation).
DefaultAppearanceAspose.Pdf.Annotations.DefaultAppearanceRead/WriteDefault appearance (font, size, colour) of the field — per published reference on WidgetAnnotation.
RectRectangle?Read/WriteThe field rectangle.
BorderBorder?Read/WriteThe field border.
ColorColorRead/WriteThe field color (stored in /DA default appearance string as RGB).
AnnotationIndexintRead/Write1-based index of the widget annotation used by AcroForm rendering when the field has multiple widgets.
FitIntoRectangleboolRead/WriteGlobal flag: when true, a field’s value is auto-resized to fit its widget rectangle.
IsGroupboolReadWhether this field is a container/group of child fields.
IsSharedFieldboolRead/WriteWhether this field belongs to a shared-fields group.
IsSynchronizedboolReadWhether the collection is thread-safe.
SyncRootobjectReadSynchronization root; returns this instance.
MaxFontSizedoubleRead/WriteMaximum font size used by the field’s appearance auto-fit.
MinFontSizedoubleRead/WriteMinimum font size used by the field’s appearance auto-fit.
MappingNamestring?Read/WriteMapping name used by external scripts to identify the field.
AnnotationTypeAnnotationTypeReadAlways Widget.
ActionsAnnotationActionCollectionReadAction slots for the widget’s /AA tree.
ExportableboolRead/WriteWhether the widget’s value should be exported on form submit.
HighlightingHighlightingModeRead/WriteVisual highlighting mode used when the user clicks the widget (/H entry).
ParentForms.Field?ReadParent Field when this widget is the visual child of an AcroForm field.
RequiredboolRead/WriteWhether the widget must be filled before submit (/Ff bit 2).
HighlightModestringReadThe highlight mode (/H entry).
DefaultAppearanceStringstring?ReadThe default appearance string (/DA entry).
FieldValuestring?ReadThe field value (/V entry).
DefaultFieldValuestring?ReadThe default field value (/DV entry).
FieldTypestring?ReadThe field type (/FT entry).
WidthdoubleRead/WriteThe width of the annotation rectangle.
HeightdoubleRead/WriteThe height of the annotation rectangle.
ActiveStatestring?Read/WriteCurrently-active appearance state (/AS entry).
AlignmentTextAlignmentRead/WriteText alignment (for free-text / widget annotations carrying rich text).
HorizontalAlignmentAspose.Pdf.HorizontalAlignmentRead/WriteHorizontal alignment, exposed in addition to Alignment; the two are independently settable.
StatesAppearanceDictionaryReadAppearance-state dictionary (the per-state sub-dict of AP/N, e.g.
UpdateAppearanceOnConvertboolRead/WriteWhether to regenerate the appearance stream when the annotation is saved into a converted document.
UseFontSubsetboolRead/WriteWhether the embedded font (if any) should be subsetted.
Contentsstring?Read/WriteThe annotation contents (text).
OpacitydoubleRead/WriteAnnotation opacity (0.0 = transparent, 1.0 = opaque).
InteriorColorColor?Read/WriteThe annotation interior color (/IC entry, for circle/square/line annotations).
Titlestring?Read/WriteThe annotation title (author for markup annotations).
Subjectstring?Read/WriteThe annotation subject (/Subj entry).
ModifiedDatestring?ReadThe modification date.
ModifiedDateTimeRead/WriteThe /M (modified) date as a typed DateTime.
AnnotationFlagsAnnotationFlagsRead/WriteTyped alias of Flags exposing AnnotationFlags as a property.
ActionPdfAction?Read/WriteThe action associated with this annotation (/A entry).
Authorstring?ReadThe annotation author (/T entry).
AnnotationStatestring?ReadThe annotation state (/State entry), e.g.
AnnotationStateModelstring?ReadThe annotation state model (/StateModel entry), e.g.
ReplyTypestring?ReadThe reply type (/RT entry), e.g.
InReplyToAnnotation?Read/WriteThe annotation this one is replying to (/IRT entry).
QuadPointsPoint[]Read/WriteQuadPoints as an array of Point values.
PagePage?ReadThe page that owns this annotation, or null when it can’t be resolved (e.g.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
MarginMarginInfo?Read/WriteOuter-margin info applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsKeptWithNextboolRead/WriteKeep this paragraph on the same page as the next one.
IsInNewPageboolRead/WriteForce the paragraph to start on a new page.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
SignatureField(doc: Document, rect: Rectangle)Create an empty signature field on doc’s first page sized to rect.
SignatureField(page: Page, rect: Rectangle)Create an empty signature field on page sized to rect.
Sign(signature: Signature)Sign this field with the supplied signature’s embedded certificate.
Sign(signature: Signature, pfx: Stream, pass: string)Sign with a PFX from a stream + password — convenience over Sign(Signature).
ExtractCertificate()Extract the signing certificate of this field’s /V as a DER byte stream (.cer).
ExtractCertificateObject()Extract the signing certificate as an X509Certificate2.
ExtractImage()Extract the visible-signature appearance (the /AP /N stream) as a Stream.
ExtractImage(format: System.Drawing.Imaging.ImageFormat)Extract the visible-signature appearance and re-encode it as format.
Field(doc: Document)Create a field bound to a document.
GetEnumerator()Iterates widget annotations for this field’s kids in the /Kids array.
CopyTo(array: Aspose.Pdf.Annotations.WidgetAnnotation[], index: int)Copy widget annotations into an array starting at index.
ExecuteFieldJavaScript(javaScriptAction: Aspose.Pdf.Annotations.JavascriptAction)Execute the supplied JavaScript action against this field.
ExportToJson(stream: Stream)Serialise this field to JSON (a single FieldExportingData object) via the supplied stream.
ExportValueToJson(outputJsonStream: Stream, indented: bool)Write the field’s name, flags and value to a JSON stream.
Flatten()Flatten this field — turn its value into static page content.
GetWidgetEnumerator()Enumerator typed to WidgetAnnotation.
ImportValueFromJson(inputJsonStream: Stream)Read this field’s value from a JSON stream.
Recalculate()Recalculate the field’s value from its calculation script.
SetPosition(point: Aspose.Pdf.Point)Move the field’s first widget rectangle to the supplied point (top-left corner).
WidgetAnnotation(doc: Document)Programmatic ctor — creates a bare widget annotation associated with doc’s reader.
GetCheckedStateName()Returns the appearance state name that represents the “on” / “checked” state of this widget (typically “Yes”), looked up from the /AP/N dict’s keys (anything that isn’t “Off”).
Accept(visitor: AnnotationSelector)Calls Accept on this SignatureField instance.
GetRectangle(considerRotation: bool)Bounding rectangle adjusted by considerRotation.
ChangeAfterResize(transform: Matrix)Adjust the annotation’s geometry after the user resized the page or the host rectangle.
UpdateAppearances()Regenerate the normal appearance stream (/AP /N) from the annotation’s current geometry and colours.
WriteXfdf(writer: System.Xml.XmlWriter)Serialize this annotation as an XFDF element to writer (PDF 32000 §12.7.8 / XFDF 3.0).
Clone()Shallow clone — copies scalar/ref-shared state.

See Also