7#include "core/fpdfdoc/cpdf_viewerpreferences.h"
9#include "core/fpdfapi/parser/cpdf_array.h"
10#include "core/fpdfapi/parser/cpdf_dictionary.h"
11#include "core/fpdfapi/parser/cpdf_document.h"
12#include "core/fpdfapi/parser/cpdf_name.h"
20 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
21 return pDict && pDict->GetByteStringFor(
"Direction") ==
"R2L";
25 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
26 return !pDict || pDict->GetByteStringFor(
"PrintScaling") !=
"None";
30 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
31 return pDict ? pDict->GetIntegerFor(
"NumCopies") : 1;
35 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
36 return pDict ? pDict->GetArrayFor(
"PrintPageRange") :
nullptr;
40 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
41 return pDict ? pDict->GetByteStringFor(
"Duplex") : ByteString
("None");
45 const ByteString& bsKey)
const {
46 RetainPtr<
const CPDF_Dictionary> pDict = GetViewerPreferences();
50 RetainPtr<
const CPDF_Name> pName = ToName(pDict->GetObjectFor(bsKey));
54 return pName->GetString();
59 const CPDF_Dictionary* pDict = m_pDoc->GetRoot();
60 return pDict ? pDict
->GetDictFor(
"ViewerPreferences") :
nullptr;
RetainPtr< const CPDF_Dictionary > GetDictFor(const ByteString &key) const
bool IsDirectionR2L() const
RetainPtr< const CPDF_Array > PrintPageRange() const
int32_t NumCopies() const
CPDF_ViewerPreferences(const CPDF_Document *pDoc)
ByteString Duplex() const
absl::optional< ByteString > GenericName(const ByteString &bsKey) const
~CPDF_ViewerPreferences()
bool PrintScaling() const
ByteString(const char *ptr)