This commit is contained in:
John Whitington 2023-05-05 16:27:41 +01:00
parent 65f7d5aef9
commit d98556e89b
1 changed files with 7 additions and 1 deletions

View File

@ -221,14 +221,20 @@ let minimum_resource_number pdf range =
| [] -> 0 | [] -> 0
| n::_ -> n + 1 | n::_ -> n + 1
let contains_specials drawops =
List.exists (function SpecialText _ -> true | _ -> false) drawops
let draw_single ~filename ~bates ~batespad fast range pdf drawops = let draw_single ~filename ~bates ~batespad fast range pdf drawops =
res.num <- minimum_resource_number pdf range; res.num <- minimum_resource_number pdf range;
let endpage = Pdfpage.endpage pdf in let endpage = Pdfpage.endpage pdf in
let pages = Pdfpage.pages_of_pagetree pdf in let pages = Pdfpage.pages_of_pagetree pdf in
let str =
if contains_specials drawops then None else Some (Pdfops.string_of_ops (ops_of_drawops pdf endpage filename bates batespad 0 (hd pages) drawops))
in
let ss = let ss =
map2 map2
(fun n p -> (fun n p ->
if mem n range then Pdfops.string_of_ops (ops_of_drawops pdf endpage filename bates batespad n p drawops) else "") if mem n range then (match str with Some x -> x | None -> Pdfops.string_of_ops (ops_of_drawops pdf endpage filename bates batespad n p drawops)) else "")
(ilist 1 endpage) (ilist 1 endpage)
pages pages
in in