diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 3992981..5682eb1 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -2627,7 +2627,10 @@ let specs = " Create a new PDF"); ("-create-pdf-ua-1", 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", Arg.Int setcreatepdfpages, " Number of pages for new PDF"); @@ -4621,6 +4624,7 @@ let expand_args argv = let rec expand_recipes = function | [] -> [] | "-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 let expand_recipes argv = diff --git a/cpdfua.ml b/cpdfua.ml index a75cbfc..1ace6ae 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -1595,3 +1595,14 @@ let cpdfua_args title = "AND"; "-replace-obj"; "/Root/StructTreeRoot/Type={\"N\":\"/StructTreeRoot\"}"; "AND"; "-set-version"; "7"; "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"] diff --git a/cpdfua.mli b/cpdfua.mli index 7fb62bf..f8976e4 100644 --- a/cpdfua.mli +++ b/cpdfua.mli @@ -26,3 +26,4 @@ val replace_struct_tree : Pdf.t -> Cpdfyojson.Safe.t -> unit (** / **) val cpdfua_args : string -> string list +val cpdfua2_args : string -> string list