Namespace is the xmp.Model PDF/A Extension namespace.
var ( Namespace = xmp.NewNamespace("pdfaExtension", "http://www.aiim.org/pdfa/ns/extension/", NewModel) SchemaNS = xmp.NewNamespace("pdfaSchema", "http://www.aiim.org/pdfa/ns/schema#", nil) PropertyNS = xmp.NewNamespace("pdfaProperty", "http://www.aiim.org/pdfa/ns/property#", nil) ValueTypeNS = xmp.NewNamespace("pdfaType", "http://www.aiim.org/pdfa/ns/type#", nil) FieldNS = xmp.NewNamespace("pdfaField", "http://www.aiim.org/pdfa/ns/field#", nil) )
FieldResourceEventSchema is the definition of the ResourceEvent field schema.
var FieldResourceEventSchema = Schema{ NamespaceURI: "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#", Prefix: "stEvt", Schema: "Definition of basic value type ResourceEvent", Property: []Property{ { Category: PropertyCategoryInternal, Description: "The action that occurred. Defined values are: converted, copied, created, cropped, edited, fil-tered, formatted, version_updated, printed, published, managed, produced, resized.New values should be verbs in the past tense.", Name: "action", ValueType: "Open Choice", }, { Category: PropertyCategoryInternal, Description: "The instance ID of the modified resource", Name: "instanceID", ValueType: ValueTypeNameURI, }, { Category: PropertyCategoryInternal, Description: "Additional description of the action", Name: "parameters", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "The software agent that performed the action", Name: "softwareAgent", ValueType: ValueTypeNameAgentName, }, { Category: PropertyCategoryInternal, Description: "Optional timestamp of when the action occurred", Name: "when", ValueType: ValueTypeNameDate, }, }, ValueType: nil, }
FieldVersionSchema is the schema for the basic Version field.
var FieldVersionSchema = Schema{ NamespaceURI: "http://ns.adobe.com/xap/1.0/sType/Version#", Prefix: "stVer", Schema: "Basic value type Version", Property: []Property{ { Category: PropertyCategoryInternal, Description: "Comments concerning what was changed", Name: "comments", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "High level, formal description of what operation the user performed.", Name: "event", ValueType: ValueTypeResourceEvent, }, { Category: PropertyCategoryInternal, Description: "The date on which this version was checked in.", Name: "modifyDate", ValueType: ValueTypeNameDate, }, { Category: PropertyCategoryInternal, Description: "The person who modified this version.", Name: "modifier", ValueType: ValueTypeNameProperName, }, { Category: PropertyCategoryInternal, Description: "The new version number.", Name: "version", ValueType: ValueTypeNameText, }, }, ValueType: nil, }
var PdfSchema = Schema{ NamespaceURI: "http://ns.adobe.com/pdf/1.3/", Prefix: "pdf", Schema: "Adobe PDF Schema", Property: Properties{ { Category: PropertyCategoryInternal, Description: "Keywords", Name: "Keywords", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "The PDF file version (for example: 1.0, 1.3, and so on).", Name: "PDFVersion", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "The name of the tool that created the PDF document.", Name: "Producer", ValueType: ValueTypeNameAgentName, }, { Category: PropertyCategoryInternal, Description: "Indicates that this is a rights-managed resource..", Name: "Marked", ValueType: ValueTypeNameBoolean, }, }, }
XmpIDQualSchema is the definition of the xmpidq schema.
var XmpIDQualSchema = Schema{ NamespaceURI: "http://ns.adobe.com/xmp/Identifier/qual/1.0/", Prefix: "xmpidq", Schema: "XMP xmpidq qualifier", Property: []Property{ { Category: PropertyCategoryInternal, Name: "Scheme", Description: "A qualifier providing the n ame of the formal identification scheme used for an item in the xmp:Identifier array.", ValueType: ValueTypeNameText, }, }, ValueType: nil, }
XmpMediaManagementSchema is the definition of xmpMM schema.
var XmpMediaManagementSchema = Schema{ NamespaceURI: "http://ns.adobe.com/xap/1.0/mm/", Prefix: "xmpMM", Schema: "XMP Media Management", Property: []Property{ { Category: PropertyCategoryInternal, Description: "A reference to the original document from which this one is derived.", Name: "DerivedFrom", ValueType: ValueTypeNameResourceRef, }, { Category: PropertyCategoryInternal, Description: "The common identifier for all versions and renditions of a resource", Name: "DocumentID", ValueType: ValueTypeNameURI, }, { Category: PropertyCategoryInternal, Description: "UUID based identifier for specific incarnation of a document", Name: "InstanceID", ValueType: ValueTypeNameURI, }, { Category: PropertyCategoryInternal, Description: "The common identifier for all versions and renditions of a document", Name: "OriginalDocumentID", ValueType: ValueTypeNameURI, }, { Category: PropertyCategoryInternal, Description: "The rendition class name for this resource", Name: "RenditionClass", ValueType: ValueTypeNameRenditionClass, }, { Category: PropertyCategoryInternal, Description: "Can be used to provide additional rendition parameters that are too complex or verbose to encode in", Name: "RenditionParams", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "The document version identifier for this resource.", Name: "VersionID", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryExternal, Description: "The version history associated with this resource", Name: "Versions", ValueType: SeqOfValueTypeName(ValueTypeNameVersion), }, { Category: PropertyCategoryInternal, Description: "The referenced resource's manager", Name: "Manager", ValueType: ValueTypeNameAgentName, }, { Category: PropertyCategoryInternal, Description: "The referenced resource's manager variant.", Name: "ManagerVariant", ValueType: ValueTypeNameText, }, { Category: PropertyCategoryInternal, Description: "The referenced resource's manager variant.", Name: "ManagerVariant", ValueType: ValueTypeNameText, }, }, }
func FillModel(d *xmp.Document, extModel *Model) error
FillModel fills in the document XMP model.
func NewModel(name string) xmp.Model
NewModel creates a new pdfAExtension model.
func RegisterSchema(ns *xmp.Namespace, schema *Schema)
RegisterSchema registers schema extension definition.
FieldValueType is a schema that describes a field in a structured type.
type FieldValueType struct { Name string `xmp:"pdfaField:description"` Description string `xmp:"pdfaField:name"` ValueType ValueTypeName `xmp:"pdfaField:valueType"` }
Model is the pdfa extension metadata model.
type Model struct { Schemas Schemas `xmp:"pdfaExtension:schemas"` }
func MakeModel(d *xmp.Document) (*Model, error)
MakeModel creates or gets a model from document.
func (m *Model) Can(nsName string) bool
Can implements xmp.Model interface.
func (m *Model) CanTag(tag string) bool
CanTag implements xmp.Model interface.
func (m *Model) GetTag(tag string) (string, error)
GetTag implements xmp.Model interface.
func (m *Model) Namespaces() xmp.NamespaceList
Namespaces implements xmp.Model interface.
func (m *Model) SetSchema(namespaceURI string, s Schema)
SetSchema sets the schema into given model.
func (m *Model) SetTag(tag, value string) error
SetTag implements xmp.Model interface.
func (m *Model) SyncFromXMP(d *xmp.Document) error
SyncFromXMP implements xmp.Model interface.
func (m *Model) SyncModel(d *xmp.Document) error
SyncModel implements xmp.Model interface.
func (m *Model) SyncToXMP(d *xmp.Document) error
SyncToXMP implements xmp.Model interface.
Properties is a list of properties.
type Properties []Property
func (p Properties) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error
MarshalXMP implements xmp.Marshaler interface.
func (p Properties) Typ() xmp.ArrayType
Typ gets the array type of properties.
func (p *Properties) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error
UnmarshalXMP implements xmp.Unmarshaler interface.
Property is a schema that describes single property.
type Property struct { // Category is the property category. Category PropertyCategory `xmp:"pdfaProperty:category"` // Description of the property. Description string `xmp:"pdfaProperty:description"` // Name is a property name. Name string `xmp:"pdfaProperty:name"` // ValueType is the property value type. ValueType ValueTypeName `xmp:"pdfaProperty:valueType"` }
PropertyCategory is the property category enumerator.
type PropertyCategory int
const ( // PropertyCategoryUndefined is the undefined property category. PropertyCategoryUndefined PropertyCategory = iota // PropertyCategoryInternal is the default automatically created document content. PropertyCategoryInternal // PropertyCategoryExternal are properties are based on user input. PropertyCategoryExternal )
func (p PropertyCategory) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler interface.
func (p *PropertyCategory) UnmarshalText(in []byte) error
UnmarshalText implements encoding.TextUnmarshaler interface.
Schema is the pdfa extension schema.
type Schema struct { // NamespaceURI is schema namespace URI. NamespaceURI string `xmp:"pdfaSchema:namespaceURI"` // Prefix is preferred schema namespace prefix. Prefix string `xmp:"pdfaSchema:prefix"` // Schema is optional description. Schema string `xmp:"pdfaSchema:schema"` // Property is description of schema properties. Property Properties `xmp:"pdfaSchema:property"` // ValueType is description of schema-specific value types. ValueType ValueTypes `xmp:"pdfaSchema:valueType"` }
func GetSchema(namespaceURI string) (*Schema, bool)
GetSchema for provided namespace.
Schemas is the array of xmp metadata extension resources.
type Schemas []Schema
func (r Schemas) IsZero() bool
IsZero checks if the resources list has no entries.
func (r Schemas) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error
MarshalXMP implements xmp.Marshaler interface.
func (r Schemas) Typ() xmp.ArrayType
func (r *Schemas) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error
UnmarshalXMP implements xmp.Unmarshaler interface.
ValueType is the pdfa extension value type schema.
type ValueType struct { Description string `xmp:"pdfaType:description"` Field []FieldValueType `xmp:"pdfaType:field"` NamespaceURI string `xmp:"pdfaType:namespaceURI"` Prefix string `xmp:"pdfaType:prefix"` Type string `xmp:"pdfaType:type"` }
ValueTypeName is the name of the value type.
type ValueTypeName string
const ( ValueTypeNameBoolean ValueTypeName = "Boolean" ValueTypeNameDate ValueTypeName = "Date" ValueTypeNameInteger ValueTypeName = "Integer" ValueTypeNameReal ValueTypeName = "Real" ValueTypeNameText ValueTypeName = "Text" ValueTypeNameAgentName ValueTypeName = "AgentName" ValueTypeNameProperName ValueTypeName = "ProperName" ValueTypeNameXPath ValueTypeName = "XPath" ValueTypeNameGUID ValueTypeName = "GUID" ValueTypeNameLocale ValueTypeName = "Locale" ValueTypeNameMIMEType ValueTypeName = "MIMEType" ValueTypeNameRenditionClass ValueTypeName = "RenditionClass" ValueTypeNameResourceRef ValueTypeName = "ResourceRef" ValueTypeNameURL ValueTypeName = "URL" ValueTypeNameURI ValueTypeName = "URI" ValueTypeNameVersion ValueTypeName = "Version" )
const ( ValueTypeResourceEvent ValueTypeName = "ResourceEvent" )
func AltOfValueTypeName(vt ValueTypeName) ValueTypeName
AltOfValueTypeName gets the ValueTypeName of the alt of given value type names.
func BagOfValueTypeName(vt ValueTypeName) ValueTypeName
BagOfValueTypeName gets the ValueTypeName of the bag of provided value type names.
func ClosedChoiceValueTypeName(vt ValueTypeName) ValueTypeName
ClosedChoiceValueTypeName gets the closed choice of provided value type name.
func SeqOfValueTypeName(vt ValueTypeName) ValueTypeName
SeqOfValueTypeName gets a value type name of a sequence of input value type names.
ValueTypes is the slice of field value types.
type ValueTypes []FieldValueType
func (f ValueTypes) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error
MarshalXMP implements xmp.Marshaler interface.
func (f ValueTypes) Typ() xmp.ArrayType
Typ gets array type of the field value types.
func (f *ValueTypes) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error
UnmarshalXMP implements xmp.Unmarshaler interface.