Move Stamp By ID in C++

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

Move stamp by id

Move stamp ID 1 on page 1 to (200, 200).

  1. Create PdfContentEditor.
  2. Bind the PDF input with Facade::BindPdf().
  3. Move the stamp by identifier with PdfContentEditor::MoveStampById().
  4. Save the resulting PDF with PdfContentEditor::Save().
#include <Aspose.PDF.Cpp/Facades/PdfContentEditor.h>
#include <system/string.h>

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

void MoveStampById(String inputFile, String outputFile)
{
    auto pdfContentEditor = MakeObject<PdfContentEditor>();

    pdfContentEditor->BindPdf(inputFile);

    int pageId = 1;
    int stampId = 1;
    double x = 200;
    double y = 200;

    pdfContentEditor->MoveStampById(pageId, stampId, x, y);

    pdfContentEditor->Save(outputFile);
}
} // namespace Facades::Examples::PDF_ContentEditor