diff options
author | Matt Holgate <matt@emobix.co.uk> | 2014-06-27 12:30:39 +0100 |
---|---|---|
committer | Matt Holgate <matt@emobix.co.uk> | 2014-06-27 12:30:39 +0100 |
commit | 063a723b9fa50200192b01ba976ecd551461a8dc (patch) | |
tree | d66d0dc10e546470ed13bc5c9fc5720afed83c45 /platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java | |
parent | a51341c3e2ec46cb4759ca921c4fe011dc3d9dba (diff) | |
download | mupdf-063a723b9fa50200192b01ba976ecd551461a8dc.tar.xz |
Fix #695217 - don't allow annotation of encrypted PDFs
Diffstat (limited to 'platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java')
-rw-r--r-- | platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java index ec35ef7c..68aed29e 100644 --- a/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java +++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFCore.java @@ -21,11 +21,13 @@ public class MuPDFCore private long globals; private byte fileBuffer[]; private String file_format; + private boolean isUnencryptedPDF; /* The native functions */ private native long openFile(String filename); private native long openBuffer(); private native String fileFormatInternal(); + private native boolean isUnencryptedPDFInternal(); private native int countPagesInternal(); private native void gotoPageInternal(int localActionPageNum); private native float getPageWidth(); @@ -109,6 +111,7 @@ public class MuPDFCore throw new Exception(String.format(context.getString(R.string.cannot_open_file_Path), filename)); } file_format = fileFormatInternal(); + isUnencryptedPDF = isUnencryptedPDFInternal(); } public MuPDFCore(Context context, byte buffer[]) throws Exception @@ -120,6 +123,7 @@ public class MuPDFCore throw new Exception(context.getString(R.string.cannot_open_buffer)); } file_format = fileFormatInternal(); + isUnencryptedPDF = isUnencryptedPDFInternal(); } public int countPages() @@ -135,6 +139,11 @@ public class MuPDFCore return file_format; } + public boolean isUnencryptedPDF() + { + return isUnencryptedPDF; + } + private synchronized int countPagesSynchronized() { return countPagesInternal(); } |