Click or drag to resize

FieldSetValue Method (Obj)

Sets the value of the Field (i.e. the value of the field's /V key). The format of field's value varies depending on the field type.

Namespace:  pdftron.PDF
Assembly:  pdftron (in pdftron.dll) Version: 255.255.255.255
Syntax
public ViewChangeCollection SetValue(
	Obj value
)

Parameters

value
Type: pdftron.SDFObj
the new value

Return Value

Type: ViewChangeCollection
A collection of modified fields and regions
Remarks
in order to remove/erase the existing value use pass a SDF::Null object to SetValue(). In PDF, Field's value is separate from its annotation (i.e. how the field appears on the page). After you modify Field's value you need to refresh Field's appearance using RefreshAppearance() method. Alternatively, you can delete "AP" entry from the Widget annotation and set "NeedAppearances" flag in AcroForm dictionary (i.e. doc.GetAcroForm().Put("NeedAppearances", Obj.CreateBool(true));) This will force viewer application to auto-generate new field appearances every time the document is opened. Yet another option is to generate a custom annotation appearance using ElementBuilder and ElementWriter and then set the "AP" entry in the widget dictionary to the new appearance stream. This functionality is useful in applications that need advanced control over how the form fields are rendered.
See Also