summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-08-06 11:33:18 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-08-06 14:06:31 +0200
commitd8fa625712055f7210e0d2c6d0221f43b6071531 (patch)
tree73f67bff6d5d252774e7ae930c8f68036c86d270
parent5c4eb97b3e89c22278e33480d929e2b2de29fe4d (diff)
downloadmupdf-d8fa625712055f7210e0d2c6d0221f43b6071531.tar.xz
Expose both PDF encryption version and revision
Thanks to Zeniko for pointing out that version as missing.
-rw-r--r--pdf/mupdf-internal.h1
-rw-r--r--pdf/pdf_crypt.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/pdf/mupdf-internal.h b/pdf/mupdf-internal.h
index 2d5f5d97..efd9e109 100644
--- a/pdf/mupdf-internal.h
+++ b/pdf/mupdf-internal.h
@@ -239,6 +239,7 @@ void pdf_crypt_buffer(fz_context *ctx, pdf_crypt *crypt, fz_buffer *buf, int num
fz_stream *pdf_open_crypt(fz_stream *chain, pdf_crypt *crypt, int num, int gen);
fz_stream *pdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, char *name, int num, int gen);
+int pdf_crypt_version(pdf_document *doc);
int pdf_crypt_revision(pdf_document *doc);
char *pdf_crypt_method(pdf_document *doc);
int pdf_crypt_length(pdf_document *doc);
diff --git a/pdf/pdf_crypt.c b/pdf/pdf_crypt.c
index 4fc34ea8..5329e845 100644
--- a/pdf/pdf_crypt.c
+++ b/pdf/pdf_crypt.c
@@ -636,13 +636,20 @@ pdf_crypt_key(pdf_document *xref)
}
int
-pdf_crypt_revision(pdf_document *xref)
+pdf_crypt_version(pdf_document *xref)
{
if (xref->crypt)
return xref->crypt->v;
return 0;
}
+int pdf_crypt_revision(pdf_document *xref)
+{
+ if (xref->crypt)
+ return xref->crypt->r;
+ return 0;
+}
+
char *
pdf_crypt_method(pdf_document *xref)
{