diff --git a/Makefile b/Makefile index c50efdc..96aec69 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ OCAMLLDFLAGS = -g all : native-code native-code-library byte-code-library top htdoc clean :: - rm -r doc + rm -rf doc LIBINSTALL_FILES = cpdf.a cpdf.cma cpdf.cmxa \ $(foreach x,$(MODS),$x.mli) $(foreach x,$(MODS),$x.cmi) diff --git a/blank.pdf b/blank.pdf new file mode 100644 index 0000000..25c2c37 Binary files /dev/null and b/blank.pdf differ diff --git a/cpdf.ml b/cpdf.ml index c7054c5..1e31bbc 100644 --- a/cpdf.ml +++ b/cpdf.ml @@ -3253,7 +3253,7 @@ let rec ranges_of_range curr prev = function let page1 labels = mem true (map (function l -> l.Pdfpagelabels.startpage = 1) labels) -let add_page_labels pdf style prefix offset range = +let add_page_labels pdf style prefix startval range = let ranges = map extremes (ranges_of_range [] [] range) and labels = Pdfpagelabels.read pdf in let labels = @@ -3272,7 +3272,7 @@ let add_page_labels pdf style prefix offset range = {Pdfpagelabels.labelstyle = style; Pdfpagelabels.labelprefix = prefix; Pdfpagelabels.startpage = s; - Pdfpagelabels.startvalue = s + offset} + Pdfpagelabels.startvalue = startval} in labels := Pdfpagelabels.add_label !labels label e) ranges; diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 8a9d3bc..c642a9c 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3468,7 +3468,7 @@ let go () = let pdf = get_single_pdf args.op false in let range = parse_pagespec pdf (get_pagespec ()) in let offset = - match args.labeloffset with None -> 0 | Some x -> x + 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