Aspose::Pdf::Facades::Form::FillField method

Form::FillField(const System::String&, bool) method

Fills the check box field with a boolean value. Notice: Only be applied to Check Box. Please note that Aspose.Pdf.Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.CheckBoxField” you should specify full name and not “CheckBoxField”. You can use FieldNames property to explore existing field names and search required field by its partial name.

bool Aspose::Pdf::Facades::Form::FillField(const System::String &fieldName, bool beChecked)
ParameterTypeDescription
fieldNameconst System::String&The field’s name to be filled.
beCheckedboolA boolean flag: true means to check the box, while false to uncheck it.

ReturnValue

true if field was found and successfully filled.

See Also

Form::FillField(const System::String&, const System::ArrayPtr<System::String>&) method

Fill a field with multiple selections.Note: only for AcroForm List Box Field.

void Aspose::Pdf::Facades::Form::FillField(const System::String &fieldName, const System::ArrayPtr<System::String> &fieldValues)
ParameterTypeDescription
fieldNameconst System::String&The fully qualified field name.
fieldValuesconst System::ArrayPtr<System::String>&A string array which contains several items to be selected.

See Also

Form::FillField(const System::String&, const System::String&) method

Fills the field with a valid value according to a fully qualified field name. Before filling the fields, every field’s names and its corresponding valid values must be known. Both the fields’ name and values are case sensitive. Please note that Aspose.Pdf.Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.TextField” you should specify full name and not “TextField”. You can use FieldNames property to explore existing field names and search required field by its partial name.

bool Aspose::Pdf::Facades::Form::FillField(const System::String &fieldName, const System::String &fieldValue)
ParameterTypeDescription
fieldNameconst System::String&The field’s name to be filled.
fieldValueconst System::String&The field’s value which must be a valid value for some fields.

ReturnValue

true if field is found and filled successfully.

See Also

Form::FillField(const System::String&, const System::String&, bool) method

Fills field with specified value.

bool Aspose::Pdf::Facades::Form::FillField(const System::String &fieldName, const System::String &value, bool fitFontSize)
ParameterTypeDescription
fieldNameconst System::String&Name of field
valueconst System::String&New value of the field
fitFontSizeboolIf true, the font size in the edit boxes will be fitted.

ReturnValue

true if field was found and successfully filled.

See Also

Form::FillField(const System::String&, int32_t) method

Fills the radio box field with a valid index value according to a fully qualified field name. Before filling the fields, only field’s name must be known. While the value can be specified by its index. Notice: Only be applied to Radio Box, Combo Box and List Box fields. Please note that Aspose.Pdf.Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.ListBoxField” you should specify full name and not “ListBoxField”. You can use FieldNames property to explore existing field names and search required field by its partial name.

bool Aspose::Pdf::Facades::Form::FillField(const System::String &fieldName, int32_t index)
ParameterTypeDescription
fieldNameconst System::String&Name of field to be filled.
indexint32_tIndex of chosen item.

ReturnValue

true if field was found and successfully filled.

Remarks

Form form = new Form("PdfForm.pdf");
form.FillField("listboxField", 2);
form.FillField("comboboxField", 2);
form.FillField("radiobuttonField", 2);
//how to search field by its partial name:
Form form = new Form("input.pdf", "output.pdf");
foreach(string fieldName in form.FieldNames)
{
  if (fieldName.EndsWith("ListBoxField"))
  {
    Console.WriteLine("Full name is: " + fieldName);
  }
}

See Also