From 3ea4086a0b8e610b11b05df0e0f361d08af06a23 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Thu, 26 Oct 2023 17:59:57 +0100 Subject: [PATCH] Finished SplitMax implementation --- cpdfcommand.ml | 3 ++- cpdfmanual.tex | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cpdfcommand.ml b/cpdfcommand.ml index bec15c9..6c26fac 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -3185,11 +3185,12 @@ let rec split_max_search pdf s b p q = else split_max_search pdf s b p half let rec split_max enc original_filename ~squeeze output_spec s pdf = + Printf.printf "***split_max\n"; let outs = ref [] in let p = ref 1 in let endpage = Pdfpage.endpage pdf in let q = ref endpage in - while !p < !q do + while !p < !q || !p = endpage do (*Printf.printf "Calling split_max_search %i %i %i\n%!" !p !p !q;*) let newq = split_max_search pdf s !p !p !q in if newq = -1 then (Printf.eprintf "Failed to make small enough split at page %i\n" !p; exit 2) else diff --git a/cpdfmanual.tex b/cpdfmanual.tex index c13fc8c..e46f2fc 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -1,3 +1,4 @@ +%Document -split-max \documentclass{book} % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf, % dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc.