diff --git a/cpdfcommand.ml b/cpdfcommand.ml index f6df9c1..2565a7d 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -2809,7 +2809,7 @@ and specs = ("-obj", Arg.Int setprintobj, "Print object"); ("-json", Arg.Unit (fun () -> args.format_json <- true), "Format output as JSON"); ("-verify", Arg.String (fun s -> setop (Verify s) ()), "Verify conformance to a standard"); - ("-marks-as", Arg.String (fun s -> setop (MarkAs s) ()), "Mark as conforming to a standard"); + ("-mark-as", Arg.String (fun s -> setop (MarkAs s) ()), "Mark as conforming to a standard"); (* These items are undocumented *) ("-debug", Arg.Unit setdebug, ""); ("-debug-crypt", Arg.Unit (fun () -> args.debugcrypt <- true), ""); diff --git a/cpdfua.ml b/cpdfua.ml index cc19c56..008f487 100644 --- a/cpdfua.ml +++ b/cpdfua.ml @@ -231,4 +231,9 @@ let test_matterhorn_json pdf = `Assoc [("name", `String name); ("section", `String section); ("error", `String error); ("extra", extra)]) (test_matterhorn pdf)) -let mark pdf = () +let mark pdf = + let pdf2 = if Cpdfmetadata.get_metadata pdf = None then Cpdfmetadata.create_metadata pdf else pdf in + pdf.Pdf.objects <- pdf2.Pdf.objects; + pdf.Pdf.trailerdict <- pdf2.Pdf.trailerdict; + pdf.Pdf.root <- pdf.Pdf.root; + ()