Extend DUP to 999999 pages

This commit is contained in:
John Whitington 2023-03-14 18:34:16 +00:00
parent 8a82a59295
commit d425d0bc65
1 changed files with 5 additions and 1 deletions

View File

@ -118,7 +118,7 @@ let resolve_pagelabels pdf spec =
let rec parse_pagespec_inner endpage pdf spec = let rec parse_pagespec_inner endpage pdf spec =
let spec = if spec = "" then "all" else spec in 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 let spec = space_string spec in
if endpage < 1 then raise (Pdf.PDFError "This PDF file has no pages and is therefore malformed") else if endpage < 1 then raise (Pdf.PDFError "This PDF file has no pages and is therefore malformed") else
let numbers = 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)) duplicate_range (int_of_string (implode [x; y; z])) (parse_pagespec_inner endpage pdf (implode r))
| x::y::z::a::'D'::'U'::'P'::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)) 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 match rev (explode spec) with
| ['n'; 'e'; 'v'; 'e'] -> | ['n'; 'e'; 'v'; 'e'] ->