Set Submit URL in C++

Contents
[ ]

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

Set submit URL

Configure Script_Demo_Button to submit XFDF to the sample HTTPS endpoint.

  1. Create FormEditor.
  2. Bind the PDF input with Facade::BindPdf().
  3. Set the submission endpoint with FormEditor::SetSubmitUrl().
  4. Set the submission format with FormEditor::SetSubmitFlag().
  5. Save the resulting PDF with SaveableFacade::Save().
#include <Aspose.PDF.Cpp/Facades/FormEditor.h>
#include <Aspose.PDF.Cpp/Facades/SubmitFormFlag.h>
#include <system/string.h>

namespace Facades::Examples::PDF_FormEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;

void SetSubmitUrl(String inputFile, String outputFile)
{
    auto editor = MakeObject<FormEditor>();

    editor->BindPdf(inputFile);
    editor->SetSubmitUrl(u"Script_Demo_Button", u"https://www.example.com/submit");
    editor->SetSubmitFlag(u"Script_Demo_Button", SubmitFormFlag::Xfdf);
    editor->SaveableFacade::Save(outputFile);
}
} // namespace Facades::Examples::PDF_FormEditor