summaryrefslogtreecommitdiff
path: root/apps/pdfextract.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pdfextract.c')
-rw-r--r--apps/pdfextract.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pdfextract.c b/apps/pdfextract.c
index 0e87cf9f..f69fd751 100644
--- a/apps/pdfextract.c
+++ b/apps/pdfextract.c
@@ -189,7 +189,10 @@ int main(int argc, char **argv)
exit(1);
}
- xref = pdf_open_xref(ctx, infile, password);
+ xref = pdf_open_xref(ctx, infile);
+ if (pdf_needs_password(xref))
+ if (!pdf_authenticate_password(xref, password))
+ fz_throw(ctx, "cannot authenticate password: %s\n", infile);
if (fz_optind == argc)
{