Get PDF Version in C++
Contents
[
Hide
]
Use PdfFileInfo for this task. The examples below retain the original C++ code and API Reference steps.
Get PDF version
Print the PDF version.
- Create PdfFileInfo with the input PDF path.
- Read the PDF version with PdfFileInfo::GetPdfVersion().
- Close the facade with PdfFileInfo::
Close(). - Print the results or diagnostic messages shown in the example.
#include <Aspose.PDF.Cpp/Facades/PdfFileInfo.h>
#include <iostream>
#include <system/string.h>
namespace Facades::Examples::PDF_FileInfo
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
void GetPdfVersion(String inputFile)
{
auto pdfInfo = MakeObject<PdfFileInfo>(inputFile);
std::cout << std::endl;
std::cout << String(u"PDF Version: ") << pdfInfo->GetPdfVersion() << std::endl;
pdfInfo->Close();
}
} // namespace Facades::Examples::PDF_FileInfo