Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3228)

Unified Diff: core/src/fpdfdoc/doc_viewerPreferences.cpp

Issue 345123002: Add support to extract viewer preference (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase and warning fix Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfdoc/fpdf_doc.h ('k') | fpdfsdk/include/fpdfview.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_viewerPreferences.cpp
diff --git a/core/src/fpdfdoc/doc_viewerPreferences.cpp b/core/src/fpdfdoc/doc_viewerPreferences.cpp
index 617485cfc27b6e5b5d55da488991673826e65fbe..f68d3fbdc7dd13a39ad98d0fb39686b2aa77fe8b 100644
--- a/core/src/fpdfdoc/doc_viewerPreferences.cpp
+++ b/core/src/fpdfdoc/doc_viewerPreferences.cpp
@@ -29,3 +29,32 @@ FX_BOOL CPDF_ViewerPreferences::PrintScaling() const
}
return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling"));
}
+FX_INT32 CPDF_ViewerPreferences::NumCopies() const
+{
+ CPDF_Dictionary *pDict = m_pDoc->GetRoot();
+ pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
+ if (!pDict) {
+ return 1;
+ }
+ return pDict->GetInteger(FX_BSTRC("NumCopies"));
+}
+CPDF_Array* CPDF_ViewerPreferences::PrintPageRange() const
+{
+ CPDF_Dictionary *pDict = m_pDoc->GetRoot();
+ CPDF_Array *pRange = NULL;
+ pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
+ if (!pDict) {
+ return pRange;
+ }
+ pRange = pDict->GetArray(FX_BSTRC("PrintPageRange"));
+ return pRange;
+}
+CFX_ByteString CPDF_ViewerPreferences::Duplex() const
+{
+ CPDF_Dictionary *pDict = m_pDoc->GetRoot();
+ pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
+ if (!pDict) {
+ return FX_BSTRC("None");
+ }
+ return pDict->GetString(FX_BSTRC("Duplex"));
+}
« no previous file with comments | « core/include/fpdfdoc/fpdf_doc.h ('k') | fpdfsdk/include/fpdfview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698