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

Side by Side 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: Review feedback Created 6 years, 6 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 unified diff | Download patch
« fpdfsdk/include/fpdfview.h ('K') | « fpdfsdk/include/fpdfview.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fpdfview.h" 8 #include "../include/fpdfview.h"
9 #include "../include/fsdk_rendercontext.h" 9 #include "../include/fsdk_rendercontext.h"
10 #include "../include/fpdf_progressive.h" 10 #include "../include/fpdf_progressive.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 } 859 }
860 860
861 DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT documen t) 861 DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT documen t)
862 { 862 {
863 CPDF_Document* pDoc = (CPDF_Document*)document; 863 CPDF_Document* pDoc = (CPDF_Document*)document;
864 if (!pDoc) return TRUE; 864 if (!pDoc) return TRUE;
865 CPDF_ViewerPreferences viewRef(pDoc); 865 CPDF_ViewerPreferences viewRef(pDoc);
866 return viewRef.PrintScaling(); 866 return viewRef.PrintScaling();
867 } 867 }
868 868
869 DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document)
870 {
871 CPDF_Document* pDoc = (CPDF_Document*)document;
872 if (!pDoc) return TRUE;
873 CPDF_ViewerPreferences viewRef(pDoc);
874 return viewRef.NumCopies();
875 }
876
877 DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document)
878 {
879 CPDF_Document* pDoc = (CPDF_Document*)document;
880 if (!pDoc) return NULL;
881 CPDF_ViewerPreferences viewRef(pDoc);
882 return viewRef.PrintPageRange();
883 }
884
885 DLLEXPORT int STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT document)
886 {
887 CPDF_Document* pDoc = (CPDF_Document*)document;
888 if (!pDoc) return FALSE;
889 CPDF_ViewerPreferences viewRef(pDoc);
890 return viewRef.Duplex();
891 }
892
869 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_ BYTESTRING name) 893 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_ BYTESTRING name)
870 { 894 {
871 if (document == NULL) 895 if (document == NULL)
872 return NULL; 896 return NULL;
873 if (name == NULL || name[0] == 0) 897 if (name == NULL || name[0] == 0)
874 return NULL; 898 return NULL;
875 899
876 CPDF_Document* pDoc = (CPDF_Document*)document; 900 CPDF_Document* pDoc = (CPDF_Document*)document;
877 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 901 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
878 return name_tree.LookupNamedDest(pDoc, name); 902 return name_tree.LookupNamedDest(pDoc, name);
879 } 903 }
OLDNEW
« fpdfsdk/include/fpdfview.h ('K') | « fpdfsdk/include/fpdfview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698