summaryrefslogtreecommitdiff
path: root/apps/pdfshow.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-10-08 23:02:29 +0200
committerRobin Watts <robin.watts@artifex.com>2012-10-10 13:01:40 +0100
commitb674a68e91824e82f2930f47a4ee33ef2e66f5b0 (patch)
tree7cba337957d93cce5569a88808ad382c156e4404 /apps/pdfshow.c
parent374566c9bcceb4753ccfa0fa273f978af4de6533 (diff)
downloadmupdf-b674a68e91824e82f2930f47a4ee33ef2e66f5b0.tar.xz
Add showing of encryption dictionary to pdfshow
Diffstat (limited to 'apps/pdfshow.c')
-rw-r--r--apps/pdfshow.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/pdfshow.c b/apps/pdfshow.c
index 655493f9..275c5e18 100644
--- a/apps/pdfshow.c
+++ b/apps/pdfshow.c
@@ -28,6 +28,20 @@ static void showtrailer(void)
printf("\n");
}
+static void showencrypt(void)
+{
+ pdf_obj *encrypt;
+
+ if (!doc)
+ fz_throw(ctx, "no file specified");
+ encrypt = pdf_dict_gets(doc->trailer, "Encrypt");
+ if (!encrypt)
+ fz_throw(ctx, "document not encrypted");
+ printf("encryption dictionary\n");
+ pdf_fprint_obj(stdout, pdf_resolve_indirect(encrypt), 0);
+ printf("\n");
+}
+
static void showxref(void)
{
if (!doc)
@@ -217,6 +231,7 @@ int pdfshow_main(int argc, char **argv)
switch (argv[fz_optind][0])
{
case 't': showtrailer(); break;
+ case 'e': showencrypt(); break;
case 'x': showxref(); break;
case 'p': showpagetree(); break;
case 'g': showgrep(filename); break;