mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-03-10 16:40:11 +01:00
error handling
This commit is contained in:
parent
3526acb3ac
commit
140c48933b
@ -418,4 +418,8 @@ let to_output o parse_content no_stream_data decompress_streams pdf =
|
||||
(* FIXME Proper streaming to output / from input, rather than making a big string first. *)
|
||||
let of_input i =
|
||||
let content = Pdfio.string_of_bytes (Pdfio.bytes_of_input i 0 (i.Pdfio.in_channel_length)) in
|
||||
pdf_of_json (J.from_string content)
|
||||
let json =
|
||||
try J.from_string content with
|
||||
e -> error (Printexc.to_string e)
|
||||
in
|
||||
pdf_of_json json
|
||||
|
Loading…
x
Reference in New Issue
Block a user