More page label work

This commit is contained in:
John Whitington 2014-09-17 17:03:42 +01:00
parent 76aadd87fb
commit da901666b9
1 changed files with 8 additions and 0 deletions

View File

@ -3256,6 +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);
let labels =
if not (page1 labels) then
ref
@ -3266,6 +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;
iter
(function (s, e) ->
let label =
@ -3274,7 +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);
labels := Pdfpagelabels.add_label !labels label e)
ranges;
Printf.printf "After adding, we have these labels:\n";
iter (fun x -> flprint (Pdfpagelabels.string_of_pagelabel x)) !labels;
Pdfpagelabels.write pdf !labels