Began fixes to page labels for 1.8 release
This commit is contained in:
parent
0ee7c2a6b3
commit
76aadd87fb
2
Makefile
2
Makefile
|
@ -14,7 +14,7 @@ OCAMLLDFLAGS = -g
|
||||||
all : native-code native-code-library byte-code-library top htdoc
|
all : native-code native-code-library byte-code-library top htdoc
|
||||||
|
|
||||||
clean ::
|
clean ::
|
||||||
rm -r doc
|
rm -rf doc
|
||||||
|
|
||||||
LIBINSTALL_FILES = cpdf.a cpdf.cma cpdf.cmxa \
|
LIBINSTALL_FILES = cpdf.a cpdf.cma cpdf.cmxa \
|
||||||
$(foreach x,$(MODS),$x.mli) $(foreach x,$(MODS),$x.cmi)
|
$(foreach x,$(MODS),$x.mli) $(foreach x,$(MODS),$x.cmi)
|
||||||
|
|
4
cpdf.ml
4
cpdf.ml
|
@ -3253,7 +3253,7 @@ let rec ranges_of_range curr prev = function
|
||||||
let page1 labels =
|
let page1 labels =
|
||||||
mem true (map (function l -> l.Pdfpagelabels.startpage = 1) 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)
|
let ranges = map extremes (ranges_of_range [] [] range)
|
||||||
and labels = Pdfpagelabels.read pdf in
|
and labels = Pdfpagelabels.read pdf in
|
||||||
let labels =
|
let labels =
|
||||||
|
@ -3272,7 +3272,7 @@ let add_page_labels pdf style prefix offset range =
|
||||||
{Pdfpagelabels.labelstyle = style;
|
{Pdfpagelabels.labelstyle = style;
|
||||||
Pdfpagelabels.labelprefix = prefix;
|
Pdfpagelabels.labelprefix = prefix;
|
||||||
Pdfpagelabels.startpage = s;
|
Pdfpagelabels.startpage = s;
|
||||||
Pdfpagelabels.startvalue = s + offset}
|
Pdfpagelabels.startvalue = startval}
|
||||||
in
|
in
|
||||||
labels := Pdfpagelabels.add_label !labels label e)
|
labels := Pdfpagelabels.add_label !labels label e)
|
||||||
ranges;
|
ranges;
|
||||||
|
|
|
@ -3468,7 +3468,7 @@ let go () =
|
||||||
let pdf = get_single_pdf args.op false in
|
let pdf = get_single_pdf args.op false in
|
||||||
let range = parse_pagespec pdf (get_pagespec ()) in
|
let range = parse_pagespec pdf (get_pagespec ()) in
|
||||||
let offset =
|
let offset =
|
||||||
match args.labeloffset with None -> 0 | Some x -> x
|
match args.labeloffset with None -> 1 | Some x -> x
|
||||||
in
|
in
|
||||||
Cpdf.add_page_labels pdf args.labelstyle args.labelprefix offset range;
|
Cpdf.add_page_labels pdf args.labelstyle args.labelprefix offset range;
|
||||||
write_pdf false pdf
|
write_pdf false pdf
|
||||||
|
|
Loading…
Reference in New Issue