OS X Linearization fixes

This commit is contained in:
John Whitington 2014-11-24 13:28:22 +00:00
parent 2edfe9ff1b
commit c76551e5a0
1 changed files with 12 additions and 3 deletions

15
cpdf.ml
View File

@ -22,7 +22,7 @@ let call_cpdflin cpdflin temp output best_password =
cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^ cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^
Filename.quote temp ^ " " ^ Filename.quote output Filename.quote temp ^ " " ^ Filename.quote output
in in
print_endline command;
match Sys.os_type with match Sys.os_type with
"Win32" -> "Win32" ->
(* On windows, don't use LD_LIBRARY_PATH - it will happen automatically *) (* On windows, don't use LD_LIBRARY_PATH - it will happen automatically *)
@ -31,8 +31,17 @@ let call_cpdflin cpdflin temp output best_password =
(* On other platforms, if -cpdflin was provided, or cpdflin was in the (* On other platforms, if -cpdflin was provided, or cpdflin was in the
current folder, set up LD_LIBRARY_PATH: *) current folder, set up LD_LIBRARY_PATH: *)
match cpdflin with match cpdflin with
"cpdflin" -> Sys.command (cpdflin ^ " " ^ command) "cpdflin" ->
| _ -> Sys.command ("LD_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^ command) print_endline command;
Sys.command command
| _ ->
let command =
"DYLD_FALLBACK_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
"LD_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
command
in
print_endline command;
Sys.command command
(* Recompress anything which isn't compressed, unless it's metadata. *) (* Recompress anything which isn't compressed, unless it's metadata. *)
let recompress_stream pdf = function let recompress_stream pdf = function