From c5cab025cef52c171d913f1840a24ce93f483298 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 19 Sep 2014 19:16:31 -0700 Subject: Add FPDF_GetSecurityHandlerRevision Security handler revision number is needed to interpret file permission. BUG=None R=thestig@chromium.org Review URL: https://codereview.chromium.org/589813002 --- fpdfsdk/src/fpdfview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fpdfsdk/src') diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 70494e02a2..49dabe300b 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -340,6 +340,17 @@ DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) return pDict->GetInteger("P"); } +DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) +{ + if (document == NULL) return -1; + CPDF_Document*pDoc = (CPDF_Document*)document; + CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser(); + CPDF_Dictionary* pDict = pParser->GetEncryptDict(); + if (pDict == NULL) return -1; + + return pDict->GetInteger("R"); +} + DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) { if (document == NULL) return 0; -- cgit v1.2.3