Clear PDF Metadata in C++
Contents
[
Hide
]
Use PdfFileInfo for this task. The examples below retain the original C++ code and API Reference steps.
Clear PDF metadata
Clear document information, save the output, and close PdfFileInfo.
- Create PdfFileInfo with the input PDF path.
- Clear document information with PdfFileInfo::ClearInfo().
- Save the resulting PDF with PdfFileInfo::
Save(). - Close the facade with PdfFileInfo::
Close().
#include <Aspose.PDF.Cpp/Facades/PdfFileInfo.h>
#include <system/string.h>
namespace Facades::Examples::PDF_FileInfo
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
void ClearPdfMetadata(String inputFile, String outputFile)
{
auto pdfInfo = MakeObject<PdfFileInfo>(inputFile);
pdfInfo->ClearInfo();
pdfInfo->Save(outputFile);
pdfInfo->Close();
}
} // namespace Facades::Examples::PDF_FileInfo