ImageEn, unit iexPdfiumCore

TPdfFormField.Value

TPdfFormField.Value


Declaration

property Value: String;


Description

Returns a string representation for the current value of a form widget.
Setting value is only supported if Field Type is fftTextField.

Read/write


Examples

// Output all field values to a memo
Memo1.Clear();
Memo1.Lines.Add( Format( 'Form Fields: %d', [ ImageEnView1.PdfViewer.FormFields.Count ]));
for i := 0 to ImageEnView1.PdfViewer.FormFields.Count -1 do
  Memo1.Lines.Add( Format( '%s (%s): %s', [ ImageEnView1.PdfViewer.FormFields[i].Name,  PdfFormFieldTypeToStr( ImageEnView1.PdfViewer.FormFields[i].FieldType ), ImageEnView1.PdfViewer.FormFields[i].Value ]));

// Clear all form field values
for i := 0 to ImageEnView1.PdfViewer.FormFields.Count -1 do
  case ImageEnView1.PdfViewer.FormFields[i].FieldType of
    fftCheckBox      : ImageEnView1.PdfViewer.FormFields[i].Checked := False;
    fftTextField     : ImageEnView1.PdfViewer.FormFields[i].Value := '';
    else
      // Default handling
                       ImageEnView1.PdfViewer.FormFields[i].Value := '';
  end;
ImageEnView1.Update();

// Set all text and checkbox values
for i := 0 to ImageEnView1.PdfViewer.FormFields.Count -1 do
  case ImageEnView1.PdfViewer.FormFields[i].FieldType of
    fftTextField     : ImageEnView1.PdfViewer.FormFields[i].Value := 'ImageEn';
    fftCheckBox      : ImageEnView1.PdfViewer.FormFields[i].Checked := TRUE;
  end;
ImageEnView1.Update();