Create PDF/UA-2

This commit is contained in:
John Whitington 2024-09-11 17:16:49 +01:00
parent eeb64d48df
commit c4b95c1eb6
3 changed files with 17 additions and 1 deletions

View File

@ -2627,7 +2627,10 @@ let specs =
" Create a new PDF"); " Create a new PDF");
("-create-pdf-ua-1", ("-create-pdf-ua-1",
Arg.String (fun _ -> ()), (* Processed elsewhere *) Arg.String (fun _ -> ()), (* Processed elsewhere *)
" Create a new PDF/UA-1 with the new title"); " Create a new PDF/UA-1 with the given title");
("-create-pdf-ua-2",
Arg.String (fun _ -> ()), (* Processed elsewhere *)
" Create a new PDF/UA-2 with the given title");
("-create-pdf-pages", ("-create-pdf-pages",
Arg.Int setcreatepdfpages, Arg.Int setcreatepdfpages,
" Number of pages for new PDF"); " Number of pages for new PDF");
@ -4621,6 +4624,7 @@ let expand_args argv =
let rec expand_recipes = function let rec expand_recipes = function
| [] -> [] | [] -> []
| "-create-pdf-ua-1"::title::t -> Cpdfua.cpdfua_args title @ expand_recipes t | "-create-pdf-ua-1"::title::t -> Cpdfua.cpdfua_args title @ expand_recipes t
| "-create-pdf-ua-2"::title::t -> Cpdfua.cpdfua2_args title @ expand_recipes t
| h::t -> h::expand_recipes t | h::t -> h::expand_recipes t
let expand_recipes argv = let expand_recipes argv =

View File

@ -1595,3 +1595,14 @@ let cpdfua_args title =
"AND"; "-replace-obj"; "/Root/StructTreeRoot/Type={\"N\":\"/StructTreeRoot\"}"; "AND"; "-replace-obj"; "/Root/StructTreeRoot/Type={\"N\":\"/StructTreeRoot\"}";
"AND"; "-set-version"; "7"; "AND"; "-set-version"; "7";
"AND"; "-mark-as"; "PDF/UA-1"] "AND"; "-mark-as"; "PDF/UA-1"]
let cpdfua2_args title =
[ "-create-pdf";
"AND"; "-set-title"; title;
"AND"; "-create-metadata";
"AND"; "-set-language"; "en-US";
"AND"; "-display-doc-title"; "true";
"AND"; "-replace-obj"; "/Root/MarkInfo/Marked=true";
"AND"; "-replace-obj"; "/Root/StructTreeRoot/Type={\"N\":\"/StructTreeRoot\"}";
"AND"; "-set-version"; "10";
"AND"; "-mark-as"; "PDF/UA-2"]

View File

@ -26,3 +26,4 @@ val replace_struct_tree : Pdf.t -> Cpdfyojson.Safe.t -> unit
(** / **) (** / **)
val cpdfua_args : string -> string list val cpdfua_args : string -> string list
val cpdfua2_args : string -> string list