diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/tools/pdfextract.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/tools/pdfextract.c b/source/tools/pdfextract.c index b46cccbd..0304845f 100644 --- a/source/tools/pdfextract.c +++ b/source/tools/pdfextract.c @@ -166,14 +166,21 @@ static void showobject(int num) if (!doc) fz_throw(ctx, FZ_ERROR_GENERIC, "no file specified"); - obj = pdf_load_object(doc, num, 0); + fz_try(ctx) + { + obj = pdf_load_object(doc, num, 0); - if (isimage(obj)) - saveimage(num); - else if (isfontdesc(obj)) - savefont(obj, num); + if (isimage(obj)) + saveimage(num); + else if (isfontdesc(obj)) + savefont(obj, num); - pdf_drop_obj(obj); + pdf_drop_obj(obj); + } + fz_catch(ctx) + { + fz_warn(ctx, "ignoring object %d", num); + } } int pdfextract_main(int argc, char **argv) |