diff options
Diffstat (limited to 'apps/pdfinfo.c')
-rw-r--r-- | apps/pdfinfo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c index a38e4f09..47f26c18 100644 --- a/apps/pdfinfo.c +++ b/apps/pdfinfo.c @@ -993,7 +993,10 @@ int main(int argc, char **argv) filename = argv[fz_optind]; printf("%s:\n", filename); - xref = pdf_open_xref(ctx, filename, password); + xref = pdf_open_xref(ctx, filename); + if (pdf_needs_password(xref)) + if (!pdf_authenticate_password(xref, password)) + fz_throw(ctx, "cannot authenticate password: %s\n", filename); pagecount = pdf_count_pages(xref); showglobalinfo(); |