1// Copyright 2014 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "../../include/fpdfdoc/fpdf_doc.h"
8CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc)
9{
10}
11CPDF_ViewerPreferences::~CPDF_ViewerPreferences()
12{
13}
14FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const
15{
16    CPDF_Dictionary *pDict = m_pDoc->GetRoot();
17    pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
18    if (!pDict)	{
19        return FALSE;
20    }
21    return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction"));
22}
23FX_BOOL CPDF_ViewerPreferences::PrintScaling() const
24{
25    CPDF_Dictionary *pDict = m_pDoc->GetRoot();
26    pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
27    if (!pDict)	{
28        return TRUE;
29    }
30    return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling"));
31}
32