From d425d0bc6511aafa76a5e739011bb068edec2fc3 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 14 Mar 2023 18:34:16 +0000 Subject: [PATCH] Extend DUP to 999999 pages --- cpdfpagespec.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpdfpagespec.ml b/cpdfpagespec.ml index 27a785a..a0d3f4a 100644 --- a/cpdfpagespec.ml +++ b/cpdfpagespec.ml @@ -118,7 +118,7 @@ let resolve_pagelabels pdf spec = let rec parse_pagespec_inner endpage pdf spec = let spec = if spec = "" then "all" else spec in - let spec = implode (resolve_pagelabels pdf (explode spec)) in + (*let spec = implode (resolve_pagelabels pdf (explode spec)) in*) let spec = space_string spec in if endpage < 1 then raise (Pdf.PDFError "This PDF file has no pages and is therefore malformed") else let numbers = @@ -134,6 +134,10 @@ let rec parse_pagespec_inner endpage pdf spec = duplicate_range (int_of_string (implode [x; y; z])) (parse_pagespec_inner endpage pdf (implode r)) | x::y::z::a::'D'::'U'::'P'::r -> duplicate_range (int_of_string (implode [x; y; z; a])) (parse_pagespec_inner endpage pdf (implode r)) + | x::y::z::a::b::'D'::'U'::'P'::r -> + duplicate_range (int_of_string (implode [x; y; z; a; b])) (parse_pagespec_inner endpage pdf (implode r)) + | x::y::z::a::b::c::'D'::'U'::'P'::r -> + duplicate_range (int_of_string (implode [x; y; z; a; b; c])) (parse_pagespec_inner endpage pdf (implode r)) | _ -> match rev (explode spec) with | ['n'; 'e'; 'v'; 'e'] ->