From 76aadd87fba8967128f8499bb1c9ff07dfe114fc Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 17 Sep 2014 15:27:25 +0100 Subject: [PATCH] Began fixes to page labels for 1.8 release --- Makefile | 2 +- blank.pdf | Bin 0 -> 1162 bytes cpdf.ml | 4 ++-- cpdfcommand.ml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 blank.pdf 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 0000000000000000000000000000000000000000..25c2c37acf1446486ad9d026b946356dce2bc4b5 GIT binary patch literal 1162 zcmah|!D`z;5KW+mvR^S5Qoq2EOZDSY?Ub2=;8uyRC9)I5b{`&3yfp|bcUwCb5E_9qNR~!r_+Cn*LKW#)L9a)0lPUR$tdCzzo<2D`{&Do3s5IW9_+^vX z4ED{K-LqeOugv7;vjS%*7n}b~r3T!h+6~5Df*)rm-W{v0bBAiuJj=`JyvyGAnxQ zoSqIZPAaspO4Y`7rsjkK^9bEN;0xgjm_vz)Hd@j?knS+X4>9helv*6+NTh}_isP&kBD}o5^IdRN3Z=kCR($y$8-nYXjD^ zID*&dT%)&(?-1SH6|Q8yH>Xm?Eb^|Y?95ff16Kr;`YK{Q^8b+HcH{;vyO~kI1JY=m HT@A<|^#Cn! literal 0 HcmV?d00001 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