diff options
Diffstat (limited to 'apps/pdfdraw.c')
-rw-r--r-- | apps/pdfdraw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c index d811df07..893b5b2b 100644 --- a/apps/pdfdraw.c +++ b/apps/pdfdraw.c @@ -445,13 +445,17 @@ int main(int argc, char **argv) fz_try(ctx) { - xref = pdf_open_xref(ctx, filename, password); + xref = pdf_open_xref(ctx, filename); } fz_catch(ctx) { fz_throw(ctx, "cannot open document: %s", filename); } + if (pdf_needs_password(xref)) + if (!pdf_authenticate_password(xref, password)) + fz_throw(ctx, "cannot authenticate password: %s", filename); + if (showxml) printf("<document name=\"%s\">\n", filename); |