OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc
) | 8 CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc
) |
9 { | 9 { |
10 } | 10 } |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 FX_BOOL CPDF_ViewerPreferences::PrintScaling() const | 23 FX_BOOL CPDF_ViewerPreferences::PrintScaling() const |
24 { | 24 { |
25 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); | 25 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
26 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); | 26 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
27 if (!pDict) { | 27 if (!pDict) { |
28 return TRUE; | 28 return TRUE; |
29 } | 29 } |
30 return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); | 30 return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling")); |
31 } | 31 } |
| 32 FX_INT32 CPDF_ViewerPreferences::NumCopies() const |
| 33 { |
| 34 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
| 35 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
| 36 if (!pDict) { |
| 37 return 1; |
| 38 } |
| 39 return pDict->GetInteger(FX_BSTRC("NumCopies")); |
| 40 } |
| 41 CPDF_Array* CPDF_ViewerPreferences::PrintPageRange() const |
| 42 { |
| 43 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
| 44 CPDF_Array *pRange = NULL; |
| 45 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
| 46 if (!pDict) { |
| 47 return pRange; |
| 48 } |
| 49 pRange = pDict->GetArray(FX_BSTRC("PrintPageRange")); |
| 50 return pRange; |
| 51 } |
| 52 CFX_ByteString CPDF_ViewerPreferences::Duplex() const |
| 53 { |
| 54 CPDF_Dictionary *pDict = m_pDoc->GetRoot(); |
| 55 pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences")); |
| 56 if (!pDict) { |
| 57 return FX_BSTRC("None"); |
| 58 } |
| 59 return pDict->GetString(FX_BSTRC("Duplex")); |
| 60 } |
OLD | NEW |