Signature Management in C++

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

Remove signature

Remove the first signature and save the modified PDF.

  1. Create PdfFileSignature.
  2. Bind the PDF input with Facade::BindPdf().
  3. Read signature identifiers with PdfFileSignature::GetSignatureNames().
  4. Remove the selected signature with PdfFileSignature::RemoveSignature().
  5. Save the resulting PDF with PdfFileSignature::Save().
#include <Aspose.PDF.Cpp/Facades/PdfFileSignature.h>
#include <Aspose.PDF.Cpp/Facades/SignatureName.h>
#include <system/collections/ilist.h>
#include <system/string.h>

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

void RemoveSignature(String inputFile, String outputFile)
{
    auto pdfSignature = MakeObject<PdfFileSignature>();
    pdfSignature->BindPdf(inputFile);
    auto signatureName = pdfSignature->GetSignatureNames()->idx_get(0);
    pdfSignature->RemoveSignature(signatureName);
    pdfSignature->Save(outputFile);
}
} // namespace Facades::Examples::PDF_FileSignature