-no-merge-struct-trees -> -no-process-struct-trees

This commit is contained in:
John Whitington 2024-01-23 13:35:49 +00:00
parent 15842dbd36
commit 019806ff63
1 changed files with 10 additions and 15 deletions

View File

@ -461,7 +461,7 @@ type args =
mutable boxes : bool; mutable boxes : bool;
mutable encrypt_metadata : bool; mutable encrypt_metadata : bool;
mutable retain_numbering : bool; mutable retain_numbering : bool;
mutable merge_struct_trees : bool; mutable process_struct_trees : bool;
mutable remove_duplicate_fonts : bool; mutable remove_duplicate_fonts : bool;
mutable remove_duplicate_streams : bool; mutable remove_duplicate_streams : bool;
mutable encoding : Cpdfmetadata.encoding; mutable encoding : Cpdfmetadata.encoding;
@ -596,7 +596,7 @@ let args =
boxes = false; boxes = false;
encrypt_metadata = true; encrypt_metadata = true;
retain_numbering = false; retain_numbering = false;
merge_struct_trees = true; process_struct_trees = true;
remove_duplicate_fonts = false; remove_duplicate_fonts = false;
remove_duplicate_streams = false; remove_duplicate_streams = false;
encoding = Cpdfmetadata.UTF8; encoding = Cpdfmetadata.UTF8;
@ -736,7 +736,7 @@ let reset_arguments () =
args.boxes <- false; args.boxes <- false;
args.encrypt_metadata <- true; args.encrypt_metadata <- true;
args.retain_numbering <- false; args.retain_numbering <- false;
args.merge_struct_trees <- true; args.process_struct_trees <- true;
args.remove_duplicate_fonts <- false; args.remove_duplicate_fonts <- false;
args.remove_duplicate_streams <- false; args.remove_duplicate_streams <- false;
args.encoding <- Cpdfmetadata.UTF8; args.encoding <- Cpdfmetadata.UTF8;
@ -2022,8 +2022,8 @@ let setextractstreamdecomp i =
let setprintobj i = let setprintobj i =
args.op <- Some (PrintObj i) args.op <- Some (PrintObj i)
let setnomergestructtrees () = let setnoprocessstructtrees () =
args.merge_struct_trees <- false args.process_struct_trees <- false
(* Parse a control file, make an argv, and then make Arg parse it. *) (* Parse a control file, make an argv, and then make Arg parse it. *)
let rec make_control_argv_and_parse filename = let rec make_control_argv_and_parse filename =
@ -2141,9 +2141,9 @@ and specs =
("-merge-add-bookmarks-use-titles", ("-merge-add-bookmarks-use-titles",
Arg.Unit setmergeaddbookmarksusetitles, Arg.Unit setmergeaddbookmarksusetitles,
" Use title of document rather than filename"); " Use title of document rather than filename");
("-no-merge-struct-trees", ("-no-process-struct-trees",
Arg.Unit setnomergestructtrees, Arg.Unit setnoprocessstructtrees,
" Do not merge structure trees"); " Do not process structure trees");
("-remove-duplicate-fonts", ("-remove-duplicate-fonts",
Arg.Unit set_remove_duplicate_fonts, Arg.Unit set_remove_duplicate_fonts,
" Remove duplicate fonts when merging"); " Remove duplicate fonts when merging");
@ -3598,12 +3598,7 @@ let extract_stream pdf decomp objnum =
output_string stdout (Pdfio.string_of_bytes data) output_string stdout (Pdfio.string_of_bytes data)
let print_obj pdf objnum = let print_obj pdf objnum =
let obj = let obj = if objnum = 0 then pdf.Pdf.trailerdict else Pdf.lookup_obj pdf objnum in
if objnum = 0 then
pdf.Pdf.trailerdict
else
Pdf.lookup_obj pdf objnum
in
Printf.printf "%S\n" (Pdfwrite.string_of_pdf obj) Printf.printf "%S\n" (Pdfwrite.string_of_pdf obj)
(* Main function *) (* Main function *)
@ -3670,7 +3665,7 @@ let go () =
in in
let outpdf = let outpdf =
Pdfmerge.merge_pdfs Pdfmerge.merge_pdfs
args.retain_numbering args.remove_duplicate_fonts ~struct_hierarchy:args.merge_struct_trees names pdfs rangenums args.retain_numbering args.remove_duplicate_fonts ~struct_hierarchy:args.process_struct_trees names pdfs rangenums
in in
if args.remove_duplicate_streams then Pdfmerge.remove_duplicate_fonts outpdf; (* JBIG2 Globals *) if args.remove_duplicate_streams then Pdfmerge.remove_duplicate_fonts outpdf; (* JBIG2 Globals *)
write_pdf false outpdf write_pdf false outpdf