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

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: Added more getters 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
« core/include/fpdfdoc/fpdf_doc.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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 *height = page.GetPageHeight(); 856 *height = page.GetPageHeight();
857 857
858 return TRUE; 858 return TRUE;
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
Vitaly Buka (NO REVIEWS) 2014/06/24 21:53:46 please remove this empty line
Nikhil 2014/06/25 09:09:47 Done.
866 return viewRef.PrintScaling(); 867 return viewRef.PrintScaling();
867 } 868 }
868 869
870 DLLEXPORT int STDCALL FPDF_VIEWERREF_GetNumCopies(FPDF_DOCUMENT document)
871 {
872 CPDF_Document* pDoc = (CPDF_Document*)document;
873 if (!pDoc) return TRUE;
874 CPDF_ViewerPreferences viewRef(pDoc);
875 return viewRef.NumCopies();
876 }
877
878 DLLEXPORT FPDF_PAGERANGE STDCALL FPDF_VIEWERREF_GetPrintPageRange(FPDF_DOCUMENT document)
879 {
880 CPDF_Document* pDoc = (CPDF_Document*)document;
881 if (!pDoc) return NULL;
882 CPDF_ViewerPreferences viewRef(pDoc);
883 return viewRef.PrintPageRange();
884 }
885
886 DLLEXPORT FPDF_BYTESTRING STDCALL FPDF_VIEWERREF_GetDuplex(FPDF_DOCUMENT documen t)
887 {
888 CPDF_Document* pDoc = (CPDF_Document*)document;
889 FPDF_BYTESTRING duplex;
890 if (!pDoc) return duplex;
891 CPDF_ViewerPreferences viewRef(pDoc);
892 duplex = viewRef.Duplex();
893 return duplex;
894 }
895
869 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_ BYTESTRING name) 896 DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_ BYTESTRING name)
870 { 897 {
871 if (document == NULL) 898 if (document == NULL)
872 return NULL; 899 return NULL;
873 if (name == NULL || name[0] == 0) 900 if (name == NULL || name[0] == 0)
874 return NULL; 901 return NULL;
875 902
876 CPDF_Document* pDoc = (CPDF_Document*)document; 903 CPDF_Document* pDoc = (CPDF_Document*)document;
877 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 904 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
878 return name_tree.LookupNamedDest(pDoc, name); 905 return name_tree.LookupNamedDest(pDoc, name);
879 } 906 }
OLDNEW
« core/include/fpdfdoc/fpdf_doc.h ('K') | « fpdfsdk/include/fpdfview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698