''' <summary>
''' Changes the text field value.
''' </summary>
''' <param name="document">The PDF document.</param>
''' <param name="fieldFullName">Full name of the field.</param>
''' <param name="newValue">The new value of the field.</param>
''' <returns>
''' <b>true</b> - field value is changed successfully;
''' <b>false</b> - field value is NOT changed.
''' </returns>
Public Shared Function ChangeTextFieldValue(document As Vintasoft.Imaging.Pdf.PdfDocument, fieldFullName As String, newValue As String) As Boolean
' if PDF document has PDF interactive form
If document.InteractiveForm IsNot Nothing Then
' find field by name
Dim field As Vintasoft.Imaging.Pdf.Tree.InteractiveForms.PdfInteractiveFormField = document.InteractiveForm.FindField(fieldFullName)
' if field is found
If field IsNot Nothing Then
Dim textField As Vintasoft.Imaging.Pdf.Tree.InteractiveForms.PdfInteractiveFormTextField = TryCast(field, Vintasoft.Imaging.Pdf.Tree.InteractiveForms.PdfInteractiveFormTextField)
' if field is text field
If textField IsNot Nothing Then
' set new value of the field
textField.Value = New Vintasoft.Imaging.Pdf.Tree.InteractiveForms.PdfInteractiveFormTextFieldStringValue(document, newValue)
Return True
End If
End If
End If
Return False
End Function