Structure tree trim calls

This commit is contained in:
John Whitington 2024-07-05 14:35:32 +01:00
parent a8b985c270
commit ea11caa28d
1 changed files with 3 additions and 7 deletions

View File

@ -3231,7 +3231,7 @@ let fast_write_split_pdfs
let marks = Pdfmarks.read_bookmarks main_pdf in let marks = Pdfmarks.read_bookmarks main_pdf in
iter2 iter2
(fun number pagenums -> (fun number pagenums ->
let pdf = Pdfpage.pdf_of_pages main_pdf pagenums in let pdf = Pdfpage.pdf_of_pages ~retain_numbering:args.retain_numbering ~process_struct_tree:args.process_struct_trees main_pdf pagenums in
let startpage, endpage = extremes pagenums in let startpage, endpage = extremes pagenums in
let name = let name =
if names <> [] then List.nth names (number - 1) else if names <> [] then List.nth names (number - 1) else
@ -3284,7 +3284,7 @@ let split_max_fits pdf s p q =
if q < p then error "split_max_fits" else if q < p then error "split_max_fits" else
let filename = Filename.temp_file "cpdf" "sm" in let filename = Filename.temp_file "cpdf" "sm" in
let range = ilist p q in let range = ilist p q in
let newpdf = Pdfpage.pdf_of_pages ~retain_numbering:args.retain_numbering pdf range in let newpdf = Pdfpage.pdf_of_pages ~process_struct_tree:args.process_struct_trees ~retain_numbering:args.retain_numbering pdf range in
let r = args.out in let r = args.out in
args.out <- File filename; args.out <- File filename;
write_pdf false newpdf; write_pdf false newpdf;
@ -3492,8 +3492,7 @@ let go () =
| [pdf] -> | [pdf] ->
if hd ranges <> "all" then if hd ranges <> "all" then
let range = parse_pagespec pdf (hd ranges) in let range = parse_pagespec pdf (hd ranges) in
(* FIXME STRUCTURE TREE TRIM *) let newpdf = Pdfpage.pdf_of_pages ~process_struct_tree:args.process_struct_trees ~retain_numbering:args.retain_numbering pdf range in
let newpdf = Pdfpage.pdf_of_pages ~retain_numbering:args.retain_numbering pdf range in
write_pdf false newpdf write_pdf false newpdf
else else
write_pdf false pdf write_pdf false pdf
@ -3921,7 +3920,6 @@ let go () =
| _ -> error "Split: bad parameters" | _ -> error "Split: bad parameters"
end end
| Some (SplitOnBookmarks level) -> | Some (SplitOnBookmarks level) ->
(* FIXME STRUCTURE TREE TRIM *)
begin match args.out with begin match args.out with
| File output_spec -> | File output_spec ->
let pdf = get_single_pdf args.op false in let pdf = get_single_pdf args.op false in
@ -3933,7 +3931,6 @@ let go () =
| NoOutputSpecified -> error "Split: No output format specified" | NoOutputSpecified -> error "Split: No output format specified"
end end
| Some (SplitMax s) -> | Some (SplitMax s) ->
(* FIXME STRUCTURE TREE TRIM *)
begin match args.out with begin match args.out with
| File output_spec -> | File output_spec ->
let pdf = get_single_pdf args.op false in let pdf = get_single_pdf args.op false in
@ -3944,7 +3941,6 @@ let go () =
| NoOutputSpecified -> error "Split: No output format specified" | NoOutputSpecified -> error "Split: No output format specified"
end end
| Some Spray -> | Some Spray ->
(* FIXME STRUCTURE TREE TRIM *)
begin match args.inputs, args.out with begin match args.inputs, args.out with
| (_, pagespec, _, _, _, _)::_, File output_spec -> | (_, pagespec, _, _, _, _)::_, File output_spec ->
let pdf = get_single_pdf args.op false in let pdf = get_single_pdf args.op false in