# Metadata

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / Metadata

# Class: Metadata

Represents XMP metadata associated with a PDF document.

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

> **new Metadata**(`metadataProperties?`): `Metadata`

Creates a new Metadata object with specified properties.

#### Parameters

##### metadataProperties?

[`MetadataProperties`](../type-aliases/MetadataProperties)

The optional settings for creating Metadata.

#### Returns

`Metadata`

#### Overrides

`ObjectBase.constructor`

### Constructor

> **new Metadata**(`om`, `metadataProperties?`): `Metadata`

Creates a new Metadata object with specified properties.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

An object manager that controls the lifetime of the Metadata object.

##### metadataProperties?

[`MetadataProperties`](../type-aliases/MetadataProperties)

The optional settings for creating Metadata.

#### Returns

`Metadata`

#### Overrides

`ObjectBase.constructor`

## Accessors

### contributors

#### Get Signature

> **get** **contributors**(): `string`[]

Gets or sets the list of document contributors. Maps to Dublin Core 'contributor' property.

##### Returns

`string`[]

#### Set Signature

> **set** **contributors**(`value`): `void`

Gets or sets the list of document contributors. Maps to Dublin Core 'contributor' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### copyright

#### Get Signature

> **get** **copyright**(): `string`

Gets or sets the document copyright. Maps to Dublin Core 'rights' property.

##### Returns

`string`

#### Set Signature

> **set** **copyright**(`value`): `void`

Gets or sets the document copyright. Maps to Dublin Core 'rights' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### coverage

#### Get Signature

> **get** **coverage**(): `string`

Gets or sets the document coverage. Maps to Dublin Core 'coverage' property.

##### Returns

`string`

#### Set Signature

> **set** **coverage**(`value`): `void`

Gets or sets the document coverage. Maps to Dublin Core 'coverage' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### createDate

#### Get Signature

> **get** **createDate**(): `Date` \| `null`

Gets or sets the creation date. Maps to XMP 'CreateDate' property.
If null, the current date/time is used.

##### Returns

`Date` \| `null`

#### Set Signature

> **set** **createDate**(`value`): `void`

Gets or sets the creation date. Maps to XMP 'CreateDate' property.
If null, the current date/time is used.

##### Parameters

###### value

`Date` | `null`

##### Returns

`void`

***

### creators

#### Get Signature

> **get** **creators**(): `string`[]

Gets or sets the list of document creators. Maps to Dublin Core 'creator' property.

##### Returns

`string`[]

#### Set Signature

> **set** **creators**(`value`): `void`

Gets or sets the list of document creators. Maps to Dublin Core 'creator' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### creatorTool

#### Get Signature

> **get** **creatorTool**(): `string`

Gets or sets the creator tool. In PDF/A compatible documents this value
should be the same as [DocumentInfo.creator](DocumentInfo#creator).

##### Returns

`string`

#### Set Signature

> **set** **creatorTool**(`value`): `void`

Gets or sets the creator tool. In PDF/A compatible documents this value
should be the same as [DocumentInfo.creator](DocumentInfo#creator).

##### Parameters

###### value

`string`

##### Returns

`void`

***

### dates

#### Get Signature

> **get** **dates**(): `string`[]

Gets or sets the list of document dates. Maps to Dublin Core 'date' property.

##### Returns

`string`[]

#### Set Signature

> **set** **dates**(`value`): `void`

Gets or sets the list of document dates. Maps to Dublin Core 'date' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### description

#### Get Signature

> **get** **description**(): `string`

Gets or sets the document description. Maps to Dublin Core 'description' property.

##### Returns

`string`

#### Set Signature

> **set** **description**(`value`): `void`

Gets or sets the document description. Maps to Dublin Core 'description' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### identifier

#### Get Signature

> **get** **identifier**(): `string`

Gets or sets the document identifier. Maps to Dublin Core 'identifier' property.

##### Returns

`string`

#### Set Signature

> **set** **identifier**(`value`): `void`

Gets or sets the document identifier. Maps to Dublin Core 'identifier' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### keywords

#### Get Signature

> **get** **keywords**(): `string`[]

Gets or sets the list of document keywords, or subjects. Maps to Dublin Core 'subject' property.

##### Returns

`string`[]

#### Set Signature

> **set** **keywords**(`value`): `void`

Gets or sets the list of document keywords, or subjects. Maps to Dublin Core 'subject' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### languages

#### Get Signature

> **get** **languages**(): `string`[]

Gets or sets the list of document languages. Maps to Dublin Core 'language' property.

##### Returns

`string`[]

#### Set Signature

> **set** **languages**(`value`): `void`

Gets or sets the list of document languages. Maps to Dublin Core 'language' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### metadataDate

#### Get Signature

> **get** **metadataDate**(): `Date` \| `null`

Gets or sets the metadata date. Maps to XMP 'MetadataDate' property.
If null, the current date/time is used.

##### Returns

`Date` \| `null`

#### Set Signature

> **set** **metadataDate**(`value`): `void`

Gets or sets the metadata date. Maps to XMP 'MetadataDate' property.
If null, the current date/time is used.

##### Parameters

###### value

`Date` | `null`

##### Returns

`void`

***

### modifyDate

#### Get Signature

> **get** **modifyDate**(): `Date` \| `null`

Gets or sets the modification date. Maps to XMP 'ModifyDate' property.
If null, the current date/time is used.

##### Returns

`Date` \| `null`

#### Set Signature

> **set** **modifyDate**(`value`): `void`

Gets or sets the modification date. Maps to XMP 'ModifyDate' property.
If null, the current date/time is used.

##### Parameters

###### value

`Date` | `null`

##### Returns

`void`

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

***

### pdfA

#### Get Signature

> **get** **pdfA**(): [`PdfAConformanceLevel`](../enumerations/PdfAConformanceLevel)

Gets or sets the PDF/A conformance version.

##### Returns

[`PdfAConformanceLevel`](../enumerations/PdfAConformanceLevel)

#### Set Signature

> **set** **pdfA**(`value`): `void`

Gets or sets the PDF/A conformance version.

##### Parameters

###### value

[`PdfAConformanceLevel`](../enumerations/PdfAConformanceLevel)

##### Returns

`void`

***

### pdfUa

#### Get Signature

> **get** **pdfUa**(): `number` \| `null`

Gets or sets the PDF/UA conformance version.
Null indicates that the document is not PDF/UA compliant.

##### Returns

`number` \| `null`

#### Set Signature

> **set** **pdfUa**(`value`): `void`

Gets or sets the PDF/UA conformance version.
Null indicates that the document is not PDF/UA compliant.

##### Parameters

###### value

`number` | `null`

##### Returns

`void`

***

### producer

#### Get Signature

> **get** **producer**(): `string`

Gets or sets the document's producer. Maps to PDF 'Producer' property.

##### Returns

`string`

#### Set Signature

> **set** **producer**(`value`): `void`

Gets or sets the document's producer. Maps to PDF 'Producer' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### publishers

#### Get Signature

> **get** **publishers**(): `string`[]

Gets or sets the list of document publishers. Maps to Dublin Core 'publisher' property.

##### Returns

`string`[]

#### Set Signature

> **set** **publishers**(`value`): `void`

Gets or sets the list of document publishers. Maps to Dublin Core 'publisher' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### readOnly

#### Get Signature

> **get** **readOnly**(): `boolean`

Gets or sets a value indicating whether the metadata is marked as read-only.

##### Returns

`boolean`

#### Set Signature

> **set** **readOnly**(`value`): `void`

Gets or sets a value indicating whether the metadata is marked as read-only.

##### Parameters

###### value

`boolean`

##### Returns

`void`

***

### relations

#### Get Signature

> **get** **relations**(): `string`[]

Gets or sets the list of document relations. Maps to Dublin Core 'relation' property.

##### Returns

`string`[]

#### Set Signature

> **set** **relations**(`value`): `void`

Gets or sets the list of document relations. Maps to Dublin Core 'relation' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### source

#### Get Signature

> **get** **source**(): `string`

Gets or sets the document source. Maps to Dublin Core 'source' property.

##### Returns

`string`

#### Set Signature

> **set** **source**(`value`): `void`

Gets or sets the document source. Maps to Dublin Core 'source' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### title

#### Get Signature

> **get** **title**(): `string`

Gets or sets the document's title. Maps to Dublin Core 'title' property.

##### Returns

`string`

#### Set Signature

> **set** **title**(`value`): `void`

Gets or sets the document's title. Maps to Dublin Core 'title' property.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### types

#### Get Signature

> **get** **types**(): `string`[]

Gets or sets the list of document types. Maps to Dublin Core 'type' property.

##### Returns

`string`[]

#### Set Signature

> **set** **types**(`value`): `void`

Gets or sets the list of document types. Maps to Dublin Core 'type' property.

##### Parameters

###### value

`string`[]

##### Returns

`void`

***

### userProps

#### Get Signature

> **get** **userProps**(): [`MetadataUserProp`](../type-aliases/MetadataUserProp)[]

Gets or sets the list of document custom properties.

##### Returns

[`MetadataUserProp`](../type-aliases/MetadataUserProp)[]

#### Set Signature

> **set** **userProps**(`props`): `void`

Gets or sets the list of document custom properties.

##### Parameters

###### props

[`MetadataUserProp`](../type-aliases/MetadataUserProp)[]

##### Returns

`void`

## Methods

### addProperty()

> **addProperty**(`namespace`, `name`, `value`): `void`

Adds a property to metadata.

#### Parameters

##### namespace

[`UserPropNamespace`](../enumerations/UserPropNamespace)

The XML namespace.

##### name

`string`

The property name.

##### value

`string`

The property value.

#### Returns

`void`

***

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
