Remove Field in C++
Contents
[
Hide
]
Use FormEditor for this task. The examples below retain the original C++ code and API Reference steps.
Remove field
Remove the Country field from the PDF.
- Create FormEditor.
- Bind the PDF input with Facade::BindPdf().
- Remove the field with FormEditor::RemoveField().
- Save the resulting PDF with SaveableFacade::Save().
#include <Aspose.PDF.Cpp/Facades/FormEditor.h>
#include <system/string.h>
namespace Facades::Examples::PDF_FormEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
void RemoveField(String inputFile, String outputFile)
{
auto editor = MakeObject<FormEditor>();
editor->BindPdf(inputFile);
editor->RemoveField(u"Country");
editor->SaveableFacade::Save(outputFile);
}
} // namespace Facades::Examples::PDF_FormEditor