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

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 589813002: Add FPDF_GetSecurityHandlerRevision (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 { 333 {
334 if (document == NULL) return 0; 334 if (document == NULL) return 0;
335 CPDF_Document*pDoc = (CPDF_Document*)document; 335 CPDF_Document*pDoc = (CPDF_Document*)document;
336 CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser(); 336 CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
337 CPDF_Dictionary* pDict = pParser->GetEncryptDict(); 337 CPDF_Dictionary* pDict = pParser->GetEncryptDict();
338 if (pDict == NULL) return (FX_DWORD)-1; 338 if (pDict == NULL) return (FX_DWORD)-1;
339 339
340 return pDict->GetInteger("P"); 340 return pDict->GetInteger("P");
341 } 341 }
342 342
343 DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document)
344 {
345 if (document == NULL) return -1;
346 CPDF_Document*pDoc = (CPDF_Document*)document;
347 CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
348 CPDF_Dictionary* pDict = pParser->GetEncryptDict();
349 if (pDict == NULL) return -1;
350
351 return pDict->GetInteger("R");
352 }
353
343 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) 354 DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document)
344 { 355 {
345 if (document == NULL) return 0; 356 if (document == NULL) return 0;
346 return ((CPDF_Document*)document)->GetPageCount(); 357 return ((CPDF_Document*)document)->GetPageCount();
347 } 358 }
348 359
349 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index ) 360 DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index )
350 { 361 {
351 if (document == NULL) return NULL; 362 if (document == NULL) return NULL;
352 if (page_index < 0 || page_index >= FPDF_GetPageCount(document)) return NULL; 363 if (page_index < 0 || page_index >= FPDF_GetPageCount(document)) return NULL;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 { 849 {
839 if (document == NULL) 850 if (document == NULL)
840 return NULL; 851 return NULL;
841 if (name == NULL || name[0] == 0) 852 if (name == NULL || name[0] == 0)
842 return NULL; 853 return NULL;
843 854
844 CPDF_Document* pDoc = (CPDF_Document*)document; 855 CPDF_Document* pDoc = (CPDF_Document*)document;
845 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 856 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
846 return name_tree.LookupNamedDest(pDoc, name); 857 return name_tree.LookupNamedDest(pDoc, name);
847 } 858 }
OLDNEW
« 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