more
This commit is contained in:
parent
9bc5f38ec6
commit
380296a4fa
|
@ -2,8 +2,8 @@
|
||||||
let demo = false
|
let demo = false
|
||||||
let noncomp = false
|
let noncomp = false
|
||||||
let major_version = 2
|
let major_version = 2
|
||||||
let minor_version = 3
|
let minor_version = 4
|
||||||
let version_date = "(build of 13th September 2019)"
|
let version_date = "(devel build of 26th September 2019)"
|
||||||
|
|
||||||
open Pdfutil
|
open Pdfutil
|
||||||
open Pdfio
|
open Pdfio
|
||||||
|
@ -735,12 +735,12 @@ let output_page_count pdf =
|
||||||
Printf.printf "%i\n" (Pdfpage.endpage pdf)
|
Printf.printf "%i\n" (Pdfpage.endpage pdf)
|
||||||
|
|
||||||
let detect_duplicate_op op =
|
let detect_duplicate_op op =
|
||||||
if args.op <> None then
|
match args.op with
|
||||||
begin
|
None | Some Shift -> ()
|
||||||
|
| _ ->
|
||||||
Printf.eprintf "Operation %s already specified, so cannot specify operation %s.\nUse AND from Chapter 1 of the manual to chain commands together.\n"
|
Printf.eprintf "Operation %s already specified, so cannot specify operation %s.\nUse AND from Chapter 1 of the manual to chain commands together.\n"
|
||||||
(string_of_op (unopt args.op)) (string_of_op op);
|
(string_of_op (unopt args.op)) (string_of_op op);
|
||||||
exit 1
|
exit 1
|
||||||
end
|
|
||||||
|
|
||||||
let setop op () =
|
let setop op () =
|
||||||
detect_duplicate_op op;
|
detect_duplicate_op op;
|
||||||
|
|
10
cpdfcoord.ml
10
cpdfcoord.ml
|
@ -69,11 +69,11 @@ let make_num pdf page unt num =
|
||||||
| Pdfgenlex.LexName
|
| Pdfgenlex.LexName
|
||||||
(( "PW" | "PH" | "CW" | "CH" | "PMINX" | "PMINY" | "PMAXX" | "PMAXY"
|
(( "PW" | "PH" | "CW" | "CH" | "PMINX" | "PMINY" | "PMAXX" | "PMAXY"
|
||||||
| "CMINX" | "CMINY" | "CMAXX" | "CMAXY") as page_characteristic) ->
|
| "CMINX" | "CMINY" | "CMAXX" | "CMAXY") as page_characteristic) ->
|
||||||
let r =
|
(*let r =*)
|
||||||
find_page_characteristic pdf page page_characteristic
|
find_page_characteristic pdf page page_characteristic
|
||||||
in
|
(*in
|
||||||
Printf.printf "characteristic %s is %f\n" page_characteristic r;
|
Printf.printf "characteristic %s is %f\n" page_characteristic r;
|
||||||
r
|
r*)
|
||||||
| _ -> failwith "make_num"
|
| _ -> failwith "make_num"
|
||||||
in
|
in
|
||||||
match unt with
|
match unt with
|
||||||
|
@ -178,7 +178,7 @@ and parse_units pdf page numbers = function
|
||||||
let r =
|
let r =
|
||||||
find_page_characteristic pdf page page_characteristic
|
find_page_characteristic pdf page page_characteristic
|
||||||
in
|
in
|
||||||
Printf.printf "characteristic %s is %f\n" page_characteristic r;
|
(* Printf.printf "characteristic %s is %f\n" page_characteristic r;*)
|
||||||
parse_units pdf page (r::numbers) more
|
parse_units pdf page (r::numbers) more
|
||||||
| Pdfgenlex.LexName ("add" | "sub" | "mul" | "div") as op::
|
| Pdfgenlex.LexName ("add" | "sub" | "mul" | "div") as op::
|
||||||
((Pdfgenlex.LexInt _ | Pdfgenlex.LexReal _ | Pdfgenlex.LexName
|
((Pdfgenlex.LexInt _ | Pdfgenlex.LexReal _ | Pdfgenlex.LexName
|
||||||
|
@ -233,7 +233,7 @@ let parse_coordinate pdf s =
|
||||||
try
|
try
|
||||||
match parse_units_string pdf emptypage s with
|
match parse_units_string pdf emptypage s with
|
||||||
| [dx; dy] ->
|
| [dx; dy] ->
|
||||||
Printf.printf "result = %f, %f\n" dx dy;
|
(*Printf.printf "result = %f, %f\n" dx dy;*)
|
||||||
dx, dy
|
dx, dy
|
||||||
| _ -> error ("Bad coordinate specification " ^ s)
|
| _ -> error ("Bad coordinate specification " ^ s)
|
||||||
with
|
with
|
||||||
|
|
Loading…
Reference in New Issue