Error handling for -revisions with malformed files

This commit is contained in:
John Whitington 2014-12-18 17:58:26 +00:00
parent 864ceb48f4
commit e78d9e2373
1 changed files with 5 additions and 1 deletions

View File

@ -2994,7 +2994,11 @@ let go () =
| (StdIn, _, _, _, _, _)::_ -> Pdfio.input_of_channel stdin
| _ -> raise (Arg.Bad "Revisions: must be a filename or stdin")
in
Printf.printf "%i\n%!" (Pdfread.revisions input)
begin try
Printf.printf "%i\n%!" (Pdfread.revisions input)
with
_ -> soft_error "Malformed XRef table. Cannot determine number of revisions."
end
| Some Clean ->
begin match args.out with
| (File _ | Stdout) ->