# Attr

## Content

# Class: Attr

Represents a base structure attribute.

Conceptually an Attr is a dictionary whose keys are PDF names and whose values are
PDF objects. Use [Attr#putValue](#putvalue) and [Attr#removeValue](#removevalue) to manipulate the entries.

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

```ts
new Attr(): Attr;
```

Creates a new empty Attr object.

#### Returns

`Attr`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new Attr(om): Attr;
```

Creates a new empty Attr object.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

#### Returns

`Attr`

#### Overrides

```ts
ObjectBase.constructor
```

## Accessors

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

## Methods

### free()

```ts
free(): void;
```

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

#### Returns

`void`

#### Inherited from

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

***

### putValue()

```ts
putValue(key, value): void;
```

Sets the value associated with the specified key.

#### Parameters

##### key

`string`

The entry key (a PDF name).

##### value

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

The value to set.

#### Returns

`void`

***

### rebind()

```ts
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)

***

### removeValue()

```ts
removeValue(key): void;
```

Removes the value associated with the specified key.

#### Parameters

##### key

`string`

The entry key (a PDF name).

#### Returns

`void`
