github.com/unidoc/unipdf/v3@v3.55.0/model/xmputil/pdfaid/pdfaid.go (about) 1 // 2 // Copyright 2020 FoxyUtils ehf. All rights reserved. 3 // 4 // This is a commercial product and requires a license to operate. 5 // A trial license can be obtained at https://unidoc.io 6 // 7 // DO NOT EDIT: generated by unitwist Go source code obfuscator. 8 // 9 // Use of this source code is governed by the UniDoc End User License Agreement 10 // terms that can be accessed at https://unidoc.io/eula/ 11 12 package pdfaid ;import (_g "fmt";_e "github.com/trimmer-io/go-xmp/xmp";_ga "github.com/unidoc/unipdf/v3/model/xmputil/pdfaextension";); 13 14 // SyncFromXMP implements xmp.Model interface. 15 func (_bf *Model )SyncFromXMP (d *_e .Document )error {return nil };func init (){_e .Register (Namespace ,_e .XmpMetadata );_ga .RegisterSchema (Namespace ,&Schema )};var _ _e .Model =(*Model )(nil ); 16 17 // SyncModel implements xmp.Model interface. 18 func (_be *Model )SyncModel (d *_e .Document )error {return nil }; 19 20 // SyncToXMP implements xmp.Model interface. 21 func (_ef *Model )SyncToXMP (d *_e .Document )error {return nil }; 22 23 // Can implements xmp.Model interface. 24 func (_eg *Model )Can (nsName string )bool {return Namespace .GetName ()==nsName }; 25 26 // NewModel creates a new model. 27 func NewModel (name string )_e .Model {return &Model {}}; 28 29 // Namespaces implements xmp.Model interface. 30 func (_gae *Model )Namespaces ()_e .NamespaceList {return _e .NamespaceList {Namespace }}; 31 32 // Model is the XMP model for the PdfA metadata. 33 type Model struct{Part int `xmp:"pdfaid:part"`;Conformance string `xmp:"pdfaid:conformance"`;};var Schema =_ga .Schema {NamespaceURI :Namespace .URI ,Prefix :Namespace .Name ,Schema :"\u0050D\u0046/\u0041\u0020\u0049\u0044\u0020\u0053\u0063\u0068\u0065\u006d\u0061",Property :[]_ga .Property {{Category :_ga .PropertyCategoryInternal ,Description :"\u0050\u0061\u0072\u0074 o\u0066\u0020\u0050\u0044\u0046\u002f\u0041\u0020\u0073\u0074\u0061\u006e\u0064\u0061r\u0064",Name :"\u0070\u0061\u0072\u0074",ValueType :_ga .ValueTypeNameInteger },{Category :_ga .PropertyCategoryInternal ,Description :"A\u006d\u0065\u006e\u0064\u006d\u0065n\u0074\u0020\u006f\u0066\u0020\u0050\u0044\u0046\u002fA\u0020\u0073\u0074a\u006ed\u0061\u0072\u0064",Name :"\u0061\u006d\u0064",ValueType :_ga .ValueTypeNameText },{Category :_ga .PropertyCategoryInternal ,Description :"C\u006f\u006e\u0066\u006f\u0072\u006da\u006e\u0063\u0065\u0020\u006c\u0065v\u0065\u006c\u0020\u006f\u0066\u0020\u0050D\u0046\u002f\u0041\u0020\u0073\u0074\u0061\u006e\u0064\u0061r\u0064",Name :"c\u006f\u006e\u0066\u006f\u0072\u006d\u0061\u006e\u0063\u0065",ValueType :_ga .ValueTypeNameText }},ValueType :nil }; 34 var Namespace =_e .NewNamespace ("\u0070\u0064\u0066\u0061\u0069\u0064","\u0068\u0074\u0074p\u003a\u002f\u002f\u0077w\u0077\u002e\u0061\u0069\u0069\u006d\u002eo\u0072\u0067\u002f\u0070\u0064\u0066\u0061\u002f\u006e\u0073\u002f\u0069\u0064\u002f",NewModel ); 35 36 37 // GetTag implements xmp.Model interface. 38 func (_fa *Model )GetTag (tag string )(string ,error ){_c ,_a :=_e .GetNativeField (_fa ,tag );if _a !=nil {return "",_g .Errorf ("\u0025\u0073\u003a\u0020\u0025\u0076",Namespace .GetName (),_a );};return _c ,nil ;}; 39 40 // SetTag implements xmp.Model interface. 41 func (_gg *Model )SetTag (tag ,value string )error {if _ee :=_e .SetNativeField (_gg ,tag ,value );_ee !=nil {return _g .Errorf ("\u0025\u0073\u003a\u0020\u0025\u0076",Namespace .GetName (),_ee );};return nil ;}; 42 43 // MakeModel gets or create sa new model for PDF/A ID namespace. 44 func MakeModel (d *_e .Document )(*Model ,error ){_fd ,_fb :=d .MakeModel (Namespace );if _fb !=nil {return nil ,_fb ;};return _fd .(*Model ),nil ;}; 45 46 // CanTag implements xmp.Model interface. 47 func (_gc *Model )CanTag (tag string )bool {_ ,_db :=_e .GetNativeField (_gc ,tag );return _db ==nil };