Import XFDF Data in C++

Contents
[ ]

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

Import XFDF

Read XFDF data from dataFile and import it into the bound form.

  1. Create Form.
  2. Bind the PDF input with Facade::BindPdf().
  3. Import XFDF data with Form::ImportXfdf().
  4. Save the resulting PDF with Form::Save().
#include <Aspose.PDF.Cpp/Facades/Form.h>
#include <system/io/file.h>
#include <system/io/file_stream.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 ImportXfdf(String inputFile, String dataFile, String outputFile)
{
    auto form = MakeObject<Form>();
    auto inputStream = System::IO::File::OpenRead(dataFile);

    form->Facade::BindPdf(inputFile);
    form->ImportXfdf(inputStream);
    form->Save(outputFile);
}
} // namespace Facades::Examples::PDF_Form