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

Form::FillField(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(System::String fieldName, bool beChecked)
ParameterTypeDescription
fieldNameSystem::StringThe 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(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(System::String fieldName, int32_t index)
ParameterTypeDescription
fieldNameSystem::StringName 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

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

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

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

See Also

Form::FillField(System::String, 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(System::String fieldName, System::String fieldValue)
ParameterTypeDescription
fieldNameSystem::StringThe field’s name to be filled.
fieldValueSystem::StringThe 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(System::String, System::String, bool) method

Fills field with specified value.

bool Aspose::Pdf::Facades::Form::FillField(System::String fieldName, System::String value, bool fitFontSize)
ParameterTypeDescription
fieldNameSystem::StringName of field
valueSystem::StringNew 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