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

Unified Diff: fpdfsdk/src/fpdfview.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 | « fpdfsdk/include/fpdfview.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index a9aa9a8ff21705e0f178fd844014d89954344053..8a97c286aac636037333c621fd5d3fc259c720d3 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -859,6 +859,37 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT documen
return viewRef.PrintScaling();
}
+DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (!pDoc) return 1;
+ CPDF_ViewerPreferences viewRef(pDoc);
+ return viewRef.NumCopies();
+}
+
+DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (!pDoc) return NULL;
+ CPDF_ViewerPreferences viewRef(pDoc);
+ return viewRef.PrintPageRange();
+}
+
+DLLEXPORT FPDF_DUPLEXTYPE STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (!pDoc) return DuplexUndefined;
+ CPDF_ViewerPreferences viewRef(pDoc);
+ CFX_ByteString duplex = viewRef.Duplex();
+ if (FX_BSTRC("Simplex") == duplex)
+ return Simplex;
+ if (FX_BSTRC("DuplexFlipShortEdge") == duplex)
+ return DuplexFlipShortEdge;
+ if (FX_BSTRC("DuplexFlipLongEdge") == duplex)
+ return DuplexFlipLongEdge;
+ return DuplexUndefined;
+}
+
DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_BYTESTRING name)
{
if (document == NULL)
« no previous file with comments | « fpdfsdk/include/fpdfview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698