Removed filename quoting for name of commmand (Windows does not like it)
This commit is contained in:
parent
3ca92575fc
commit
f86760c38f
6
cpdf.ml
6
cpdf.ml
|
@ -70,7 +70,7 @@ let find_cpdflin provided =
|
||||||
of the cpdflin binary. Returns the exit code. *)
|
of the cpdflin binary. Returns the exit code. *)
|
||||||
let call_cpdflin cpdflin temp output best_password =
|
let call_cpdflin cpdflin temp output best_password =
|
||||||
let command =
|
let command =
|
||||||
Filename.quote cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^
|
cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^
|
||||||
Filename.quote temp ^ " " ^ Filename.quote output
|
Filename.quote temp ^ " " ^ Filename.quote output
|
||||||
in
|
in
|
||||||
match Sys.os_type with
|
match Sys.os_type with
|
||||||
|
@ -87,8 +87,8 @@ let call_cpdflin cpdflin temp output best_password =
|
||||||
Sys.command command
|
Sys.command command
|
||||||
| _ ->
|
| _ ->
|
||||||
let command =
|
let command =
|
||||||
"DYLD_FALLBACK_LIBRARY_PATH=" ^ Filename.quote (Filename.dirname cpdflin) ^ " " ^
|
"DYLD_FALLBACK_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
|
||||||
"LD_LIBRARY_PATH=" ^ Filename.quote (Filename.dirname cpdflin) ^ " " ^
|
"LD_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
|
||||||
command
|
command
|
||||||
in
|
in
|
||||||
if !debug then prerr_endline command;
|
if !debug then prerr_endline command;
|
||||||
|
|
|
@ -2116,7 +2116,7 @@ let embed_missing_fonts fi fo =
|
||||||
exit 2
|
exit 2
|
||||||
end;
|
end;
|
||||||
let gscall =
|
let gscall =
|
||||||
Filename.quote args.path_to_ghostscript ^
|
args.path_to_ghostscript ^
|
||||||
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
|
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
|
||||||
" -dBATCH " ^ Filename.quote fi
|
" -dBATCH " ^ Filename.quote fi
|
||||||
in
|
in
|
||||||
|
@ -2135,7 +2135,7 @@ let mend_pdf_file_with_ghostscript filename =
|
||||||
let tmpout = Filename.temp_file "cpdf" ".pdf" in
|
let tmpout = Filename.temp_file "cpdf" ".pdf" in
|
||||||
tempfiles := tmpout::!tempfiles;
|
tempfiles := tmpout::!tempfiles;
|
||||||
let gscall =
|
let gscall =
|
||||||
Filename.quote args.path_to_ghostscript ^
|
args.path_to_ghostscript ^
|
||||||
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote tmpout ^
|
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote tmpout ^
|
||||||
" -dBATCH " ^ Filename.quote filename
|
" -dBATCH " ^ Filename.quote filename
|
||||||
in
|
in
|
||||||
|
@ -2734,7 +2734,6 @@ let write_image pdf resources name image =
|
||||||
close_out fh;
|
close_out fh;
|
||||||
(* If pnmtopng is present, convert the pnm to a PNG. *)
|
(* If pnmtopng is present, convert the pnm to a PNG. *)
|
||||||
begin match
|
begin match
|
||||||
(* FIXME: Use Filename.quote here *)
|
|
||||||
Sys.command ("pnmtopng -gamma 0.45 -quiet " ^ "\"" ^ name ^ ".pnm\"" ^ "> \"" ^ name ^ ".png\" 2>" ^ null_device)
|
Sys.command ("pnmtopng -gamma 0.45 -quiet " ^ "\"" ^ name ^ ".pnm\"" ^ "> \"" ^ name ^ ".png\" 2>" ^ null_device)
|
||||||
with
|
with
|
||||||
| 0 -> Sys.remove (name ^ ".pnm")
|
| 0 -> Sys.remove (name ^ ".pnm")
|
||||||
|
@ -3044,7 +3043,6 @@ let startends_of_range x =
|
||||||
(* Calculating margins *)
|
(* Calculating margins *)
|
||||||
let calculate_margins filename pdf (s, e) =
|
let calculate_margins filename pdf (s, e) =
|
||||||
(* Call ghostscript *)
|
(* Call ghostscript *)
|
||||||
(* FIXME: Use Filename.quote here *)
|
|
||||||
let gscall =
|
let gscall =
|
||||||
args.path_to_ghostscript ^
|
args.path_to_ghostscript ^
|
||||||
" -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -r1200"
|
" -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -r1200"
|
||||||
|
@ -4429,7 +4427,7 @@ let gs_malformed_force fi fo =
|
||||||
exit 2
|
exit 2
|
||||||
end;
|
end;
|
||||||
let gscall =
|
let gscall =
|
||||||
Filename.quote args.path_to_ghostscript ^
|
args.path_to_ghostscript ^
|
||||||
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
|
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
|
||||||
" -dBATCH " ^ Filename.quote fi
|
" -dBATCH " ^ Filename.quote fi
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue