Get PDF Viewer Preferences in C++
Contents
[
Hide
]
Use PdfContentEditor for this task. The examples below retain the original C++ code and API Reference steps.
Get viewer preferences
Print the current viewer-preference flags.
- Create PdfContentEditor.
- Bind the PDF input with Facade::BindPdf().
- Read the viewer flags with PdfContentEditor::GetViewerPreference().
- Print the results or diagnostic messages shown in the example.
#include <Aspose.PDF.Cpp/Facades/PdfContentEditor.h>
#include <iostream>
#include <system/string.h>
namespace Facades::Examples::PDF_ContentEditor
{
using namespace System;
using namespace Aspose::Pdf;
using namespace Aspose::Pdf::Facades;
void GetViewerPreferences(String inputFile)
{
auto editor = MakeObject<PdfContentEditor>();
editor->BindPdf(inputFile);
std::cout << "Current viewer preference: " << editor->GetViewerPreference() << std::endl;
}
} // namespace Facades::Examples::PDF_ContentEditor