Fill Check Box Fields in C++
Contents
[
Hide
]
Use Form for this task. The examples below retain the original C++ code and API Reference steps.
Fill check box fields
Set subscribe_newsletter and accept_terms to the export value Yes.
- Create Form.
- Bind the PDF input with Facade::BindPdf().
- Fill the named fields with Form::FillField().
- 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 FillCheckBoxFields(String inputFile, String outputFile)
{
auto form = MakeObject<Form>();
form->Facade::BindPdf(inputFile);
form->FillField(u"subscribe_newsletter", String(u"Yes"));
form->FillField(u"accept_terms", String(u"Yes"));
form->Save(outputFile);
}
} // namespace Facades::Examples::PDF_Form