Fill Radio Button Fields in C++

Use Form for this task. The examples below retain the original C++ code and API Reference steps.

Fill radio button fields

Select option index 0 in the gender field.

  1. Create Form.
  2. Bind the PDF input with Facade::BindPdf().
  3. Fill the named fields with Form::FillField().
  4. Save the resulting PDF with Form::Save().
#include <Aspose.PDF.Cpp/Facades/Form.h>
#include <system/string.h>

namespace Facades::Examples::PDF_Form
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
using Form = Aspose::Pdf::Facades::Form;

void FillRadioButtonFields(String inputFile, String outputFile)
{
    auto form = MakeObject<Form>();
    form->Facade::BindPdf(inputFile);
    form->FillField(u"gender", 0);
    form->Save(outputFile);
}
} // namespace Facades::Examples::PDF_Form