From 8d7bb3ff50943fa51ac1d968930bd23071376904 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 27 Sep 2009 20:05:38 +0000 Subject: add methods for getting encryption data git-svn-id: svn+q:///qpdf/trunk@733 71b93d88-0707-0410-a8cf-f5a4172ac649 --- include/qpdf/QPDF.hh | 23 +++++++++++++++++++++++ include/qpdf/qpdf-c.h | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 1a5ed649..34e0842c 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -128,6 +128,29 @@ class QPDF DLL_EXPORT bool isEncrypted() const; + DLL_EXPORT + bool isEncrypted(int& R, int& P); + + // Encryption permissions -- not enforced by QPDF + DLL_EXPORT + bool allowAccessibility(); + DLL_EXPORT + bool allowExtractAll(); + DLL_EXPORT + bool allowPrintLowRes(); + DLL_EXPORT + bool allowPrintHighRes(); + DLL_EXPORT + bool allowModifyAssembly(); + DLL_EXPORT + bool allowModifyForm(); + DLL_EXPORT + bool allowModifyAnnotation(); + DLL_EXPORT + bool allowModifyOther(); + DLL_EXPORT + bool allowModifyAll(); + // Helper function to trim padding from user password. Calling // trim_user_password on the result of getPaddedUserPassword gives // getTrimmedUserPassword's result. diff --git a/include/qpdf/qpdf-c.h b/include/qpdf/qpdf-c.h index 2f0096f5..11dae4f1 100644 --- a/include/qpdf/qpdf-c.h +++ b/include/qpdf/qpdf-c.h @@ -161,6 +161,25 @@ extern "C" { DLL_EXPORT QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf); + DLL_EXPORT + QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf); + /* WRITE FUNCTIONS */ /* Set up for writing. No writing is actually performed until the -- cgit v1.2.3-54-g00ecf