Import XML Data in C++
Contents
[
Hide
]
Use Form for this task. The examples below retain the original C++ code and API Reference steps.
Import XML
Read XML data from dataFile and import it into the bound form.
- Create Form.
- Bind the PDF input with Facade::BindPdf().
- Import XML data with Form::ImportXml().
- 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 ImportXml(String inputFile, String dataFile, String outputFile)
{
auto form = MakeObject<Form>();
auto inputStream = System::IO::File::OpenRead(dataFile);
form->Facade::BindPdf(inputFile);
form->ImportXml(inputStream);
form->Save(outputFile);
}
} // namespace Facades::Examples::PDF_Form