diff --git a/blank.pdf b/blank.pdf index 25c2c37..b717989 100644 Binary files a/blank.pdf and b/blank.pdf differ diff --git a/cpdf.ml b/cpdf.ml index 48b0961..a6eed2a 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -3256,8 +3256,8 @@ let page1 labels = let add_page_labels pdf style prefix startval range = let ranges = map extremes (ranges_of_range [] [] range) and labels = Pdfpagelabels.read pdf in - Printf.printf "We have %i existing labels\n" (List.length labels); - Printf.printf "We have %i ranges to apply these labels to\n" (List.length ranges); + (*Printf.printf "We have %i existing labels\n" (List.length labels); + Printf.printf "We have %i ranges to apply these labels to\n" (List.length ranges);*) let labels = if not (page1 labels) then ref @@ -3268,8 +3268,8 @@ let add_page_labels pdf style prefix startval range = else ref labels in - Printf.printf "Before adding, we have these labels:\n"; - iter (fun x -> flprint (Pdfpagelabels.string_of_pagelabel x)) !labels; + (*Printf.printf "Before adding, we have these labels:\n"; + iter (fun x -> flprint (Pdfpagelabels.string_of_pagelabel x)) !labels;*) iter (function (s, e) -> let label = @@ -3278,11 +3278,11 @@ let add_page_labels pdf style prefix startval range = Pdfpagelabels.startpage = s; Pdfpagelabels.startvalue = startval} in - Printf.printf "We are adding this label:\n"; - flprint (Pdfpagelabels.string_of_pagelabel label); + (*Printf.printf "We are adding this label:\n"; + flprint (Pdfpagelabels.string_of_pagelabel label);*) labels := Pdfpagelabels.add_label (Pdfpage.endpage pdf) !labels label e) ranges; - Printf.printf "After adding, we have these labels:\n"; - iter (fun x -> flprint (Pdfpagelabels.string_of_pagelabel x)) !labels; + (*Printf.printf "After adding, we have these labels:\n"; + iter (fun x -> flprint (Pdfpagelabels.string_of_pagelabel x)) !labels;*) Pdfpagelabels.write pdf !labels diff --git a/cpdfcommand.ml b/cpdfcommand.ml index ad05bcb..2e06e6b 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -257,7 +257,7 @@ type args = mutable uprightstamp : bool; mutable labelstyle : Pdfpagelabels.labelstyle; mutable labelprefix : string option; - mutable labeloffset : int option; + mutable labelstartval : int; mutable squeeze : bool} (* List of all filenames in any AND stage - this is used to check that we don't @@ -340,7 +340,7 @@ let args = uprightstamp = false; labelstyle = Pdfpagelabels.DecimalArabic; labelprefix = None; - labeloffset = None; + labelstartval = 1; squeeze = false} let reset_arguments () = @@ -414,7 +414,7 @@ let reset_arguments () = args.uprightstamp <- false; args.labelstyle <- Pdfpagelabels.DecimalArabic; args.labelprefix <- None; - args.labeloffset <- None; + args.labelstartval <- 1; args.squeeze <- false (* We don't reset args.do_ask and args.verbose, because they operate on all parts of the AND-ed command line sent from cpdftk. *) @@ -1221,8 +1221,8 @@ let setlabelstyle s = let setlabelprefix s = args.labelprefix <- Some s -let setlabeloffset i = - args.labeloffset <- Some i +let setlabelstartval i = + args.labelstartval <- i (* Parse a control file, make an argv, and then make Arg parse it. *) let rec make_control_argv_and_parse filename = @@ -1702,9 +1702,9 @@ and specs = ("-label-prefix", Arg.String setlabelprefix, " Set label prefix (default none)"); - ("-label-offset", - Arg.Int setlabeloffset, - " Set label offset (default 1)"); + ("-label-startval", + Arg.Int setlabelstartval, + " Set label start value (default 1)"); (* These items are for cpdftk *) ("-update-info", Arg.String setupdateinfo, ""); ("-printf-format", Arg.Unit setprintfformat, ""); @@ -3468,11 +3468,9 @@ let go () = | Some AddPageLabels -> let pdf = get_single_pdf args.op false in let range = parse_pagespec pdf (get_pagespec ()) in - let offset = - match args.labeloffset with None -> 1 | Some x -> x - in - Cpdf.add_page_labels pdf args.labelstyle args.labelprefix offset range; - write_pdf false pdf + Cpdf.add_page_labels + pdf args.labelstyle args.labelprefix args.labelstartval range; + write_pdf false pdf | Some RemovePageLabels -> let pdf = get_single_pdf args.op false in Pdfpagelabels.remove pdf; diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf index 682ee0e..086e82a 100644 Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ diff --git a/cpdfmanual.tex b/cpdfmanual.tex index 0e44e5b..1887254 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -1568,7 +1568,7 @@ given page range. \small\noindent\verb!cpdf -add-page-labels in.pdf -o out.pdf!\\ \noindent\verb! [-label-style