Add Stamp to PDF in C++
Contents
[
Hide
]
Use PdfFileStamp for this task. The examples below retain the original C++ code and API Reference steps.
Add stamp to PDF
Bind an image to a Stamp and apply it with PdfFileStamp.
- Create PdfFileStamp.
- Bind the PDF input with Facade::BindPdf().
- Apply the configured stamp with PdfFileStamp::AddStamp().
- Save the resulting PDF with PdfFileStamp::
Save().
#include <Aspose.PDF.Cpp/Facades/PdfFileStamp.h>
#include <Aspose.PDF.Cpp/Facades/Stamp.h>
#include <system/string.h>
namespace Facades::Examples::PDF_FileStamp
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
using Stamp = Aspose::Pdf::Facades::Stamp;
void AddStampToPdf(String inputFile, String imageFile, String outputFile)
{
auto pdfStamper = MakeObject<PdfFileStamp>();
pdfStamper->BindPdf(inputFile);
auto stamp = MakeObject<Stamp>();
stamp->BindImage(imageFile);
pdfStamper->AddStamp(stamp);
pdfStamper->Save(outputFile);
}
} // namespace Facades::Examples::PDF_FileStamp