This commit is contained in:
John Whitington 2023-05-10 17:03:53 +01:00
parent 22506a6c4d
commit 73701b5d7d
2 changed files with 4 additions and 2 deletions

View File

@ -4568,6 +4568,7 @@ let go_withargv argv =
(*Printf.printf "AND:%b, %s\n" islast (Array.fold_left (fun x y -> x ^ " " ^ y) "" s);
flprint "\n";*)
reset_arguments ();
drawops := [("_MAIN", [])];
process_env_vars ();
parse_argv () s (align_specs specs) anon_fun usage_msg;
parse_argv () (Array.of_list ("cpdf"::!control_args)) (align_specs specs) anon_fun usage_msg;

View File

@ -58,7 +58,7 @@ type res =
mutable current_font : Pdftext.font;
mutable num : int}
let empty_res =
let empty_res () =
{images = null_hash ();
extgstates = null_hash ();
fonts = null_hash ();
@ -69,7 +69,7 @@ let empty_res =
num = 0}
let resstack =
ref [empty_res]
ref [empty_res ()]
let res () =
hd !resstack
@ -302,6 +302,7 @@ let draw_single ~filename ~bates ~batespad fast range pdf drawops =
Pdfpage.change_pages true pdf pages
let draw ~filename ~bates ~batespad fast range pdf drawops =
resstack := [empty_res ()];
(res ()).time <- Cpdfstrftime.current_time ();
let pdf = ref pdf in
let range = ref range in