Remove deprecated -control

This commit is contained in:
John Whitington 2024-09-02 14:00:11 +01:00
parent d576946270
commit 7128c23be3
3 changed files with 18 additions and 24 deletions

28
Changes
View File

@ -3,31 +3,35 @@
Fixes: Fixes:
o Removed setting of Producer field in AGPL version o Removed setting of Producer field in AGPL version
* Removed long-deprecated -control
* New -args-json for better control files
* = Supported by a grant from NLnet
2.7.1 (July 2024) 2.7.1 (July 2024)
New features: New features:
o Build PDF files from JPEG2000 (.jp2, .jpf/.jpx) files o Build PDF files from JPEG2000 (.jp2, .jpf/.jpx) files
o Mark a file as PDF/UA compliant, or remove such marking * * Mark a file as PDF/UA compliant, or remove such marking
o Verify compliance to PDF/UA via the Matterhorn protocol * * Verify compliance to PDF/UA via the Matterhorn protocol
o Extract, edit and reapply document structure tree * * Extract, edit and reapply document structure tree
o Print structure tree summary * * Print structure tree summary
o Split structure tree when splitting PDF to save size * * Split structure tree when splitting PDF to save size
o Combine structure trees when stamping PDFs * * Combine structure trees when stamping PDFs
o Set the natural language of a file * * Set the natural language of a file
Extended features: Extended features:
o Allow -obj to look up nested PDF information o Allow -obj to look up nested PDF information
o Merge structure trees better when merging files * * Merge structure trees better when merging files
o Report top-level natural language on -info * * Report top-level natural language on -info
o Report mark information dictionary contents on -info * * Report mark information dictionary contents on -info
Backward-incompatible change: Backward-incompatible change:
o -process-struct-tree replaces -no-process-struct-tree * -process-struct-tree replaces -no-process-struct-tree
newly introduced in previous version * newly introduced in previous version
* = Supported by a grant from NLnet * = Supported by a grant from NLnet

View File

@ -1454,8 +1454,6 @@ let rec parse_chars args = function
let this, rest = getarg [] (h::t) in let this, rest = getarg [] (h::t) in
parse_chars (this::args) rest parse_chars (this::args) rest
let control_args = ref []
let parse_control_file name = let parse_control_file name =
(parse_chars [] (parse_chars []
(charlist_of_bytes (Pdfio.bytes_of_input_channel (open_in_bin name)))) (charlist_of_bytes (Pdfio.bytes_of_input_channel (open_in_bin name))))
@ -1857,11 +1855,7 @@ let setextractstreamdecomp s =
let setprintobj s = let setprintobj s =
args.op <- Some (PrintObj s) args.op <- Some (PrintObj s)
(* Parse a control file, make an argv, and then make Arg parse it. *) let specs =
let rec make_control_argv_and_parse filename =
control_args := !control_args @ parse_control_file filename
and specs =
[("-version", [("-version",
Arg.Unit (setop Version), Arg.Unit (setop Version),
" Print the cpdf version number"); " Print the cpdf version number");
@ -1958,9 +1952,6 @@ and specs =
("-fast", ("-fast",
Arg.Unit setfast, Arg.Unit setfast,
" Speed over correctness with malformed documents"); " Speed over correctness with malformed documents");
("-control",
Arg.String make_control_argv_and_parse,
" Use a control file. Deprecated. Use -args.");
("-args", ("-args",
Arg.Unit (fun () -> ()), Arg.Unit (fun () -> ()),
" Get arguments from a file."); " Get arguments from a file.");
@ -4622,7 +4613,6 @@ let go_withargv argv =
Cpdfdrawcontrol.drawops := [("_MAIN", [])]; Cpdfdrawcontrol.drawops := [("_MAIN", [])];
process_env_vars (); process_env_vars ();
parse_argv () s (align_specs specs) anon_fun usage_msg; parse_argv () s (align_specs specs) anon_fun usage_msg;
parse_argv () (Array.of_list ("cpdf"::!control_args)) (align_specs specs) anon_fun usage_msg;
let addrange pdf = AlreadyInMemory (pdf, "fromAND"), args.dashrange, "", "", ref false, None in let addrange pdf = AlreadyInMemory (pdf, "fromAND"), args.dashrange, "", "", ref false, None in
args.inputs <- rev (map addrange !output_pdfs) @ rev args.inputs; args.inputs <- rev (map addrange !output_pdfs) @ rev args.inputs;
output_pdfs := []; output_pdfs := [];

View File

@ -1,4 +1,4 @@
%Document JPEG2000 embedding %Document -control removal, -args-json addition
\documentclass{book} \documentclass{book}
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf, % Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf,
% dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc. % dotnetcpdflibmanual.pdf, jcpdflibmanual.pdf jscpdflibmanual.pdf etc.