Bind a PDF Stream and Save in C++

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

Bind from stream and save

Bind the editor to a PDF input stream and save it to outputFile.

  1. Create PdfContentEditor.
  2. Bind the PDF input with Facade::BindPdf().
  3. Save the resulting PDF with PdfContentEditor::Save().
#include <Aspose.PDF.Cpp/Facades/PdfContentEditor.h>
#include <system/io/file.h>
#include <system/io/file_stream.h>
#include <system/string.h>

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

void BindFromStreamAndSave(String inputFile, String outputFile)
{
    auto editor = MakeObject<PdfContentEditor>();
    auto inputStream = System::IO::File::OpenRead(inputFile);

    editor->BindPdf(inputStream);
    editor->Save(outputFile);
}
} // namespace Facades::Examples::PDF_ContentEditor