Remove PDF Bates numbering in C++

Pass the entire document page collection to DeleteBatesNumbering(). Unlike the first-page artifact examples, this function processes Bates numbering across the document.

Configure the SDK and choose a writable output path.

Delete Bates numbering

Remove Bates numbering through the page collection extension method.

  1. Open the input PDF with Document.
  2. Pass the document pages to PageCollectionExtensions::DeleteBatesNumbering().
  3. Save the result with Document::Save().
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/Page.h>
#include <Aspose.PDF.Cpp/PageCollection.h>
#include <Aspose.PDF.Cpp/Artifacts/Artifact.h>
#include <Aspose.PDF.Cpp/Artifacts/ArtifactCollection.h>

using namespace System;
using namespace Aspose::Pdf;

#include <Aspose.PDF.Cpp/Artifacts/Pagination/PageCollectionExtensions.h>

void DeleteBatesNumbering(System::String inputFile, System::String outputFile)
{
    auto document = MakeObject<Document>(inputFile);
    PageCollectionExtensions::DeleteBatesNumbering(document->get_Pages());
    document->Save(outputFile);
}