# EmbeddedFileStream

## Content

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

***

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

# Class: EmbeddedFileStream

Represents embedded file stream in PDF.

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

> **new EmbeddedFileStream**(`om`, `bytes`): `EmbeddedFileStream`

Initialize a new instance of the EmbeddedFileStream class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

[ObjectManager](ObjectManager) that controls the lifetime of the EmbeddedFileStream.

##### bytes

`Uint8Array`

The file data.

#### Returns

`EmbeddedFileStream`

#### Overrides

`ObjectBase.constructor`

### Constructor

> **new EmbeddedFileStream**(`bytes`): `EmbeddedFileStream`

Initialize a new instance of the EmbeddedFileStream class.

#### Parameters

##### bytes

`Uint8Array`

The file data.

#### Returns

`EmbeddedFileStream`

#### Overrides

`ObjectBase.constructor`

## Accessors

### checkSum

#### Get Signature

> **get** **checkSum**(): `Uint8Array`\<`ArrayBufferLike`\> \| `null`

Gets or sets a 16-byte string that is the checksum of the bytes of the uncompressed embedded file.
The checksum is calculated by applying the standard MD5 message-digest algorithm
to the bytes of the embedded file stream.
Checksum calculated automatically when EmbeddedFileStream is created.

##### Returns

`Uint8Array`\<`ArrayBufferLike`\> \| `null`

#### Set Signature

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

Gets or sets a 16-byte string that is the checksum of the bytes of the uncompressed embedded file.
The checksum is calculated by applying the standard MD5 message-digest algorithm
to the bytes of the embedded file stream.
Checksum calculated automatically when EmbeddedFileStream is created.

##### Parameters

###### value

`Uint8Array`\<`ArrayBufferLike`\> | `null`

##### Returns

`void`

***

### creationDate

#### Get Signature

> **get** **creationDate**(): [`PdfDateTime`](../type-aliases/PdfDateTime) \| `null`

Gets or sets the date and time when the embedded file was created.

##### Returns

[`PdfDateTime`](../type-aliases/PdfDateTime) \| `null`

#### Set Signature

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

Gets or sets the date and time when the embedded file was created.

##### Parameters

###### value

[`PdfDateTime`](../type-aliases/PdfDateTime) | `null`

##### Returns

`void`

***

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### mimeType

#### Get Signature

> **get** **mimeType**(): `string` \| `null`

Gets or sets the file's MIME type.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the file's MIME type.

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

***

### modificationDate

#### Get Signature

> **get** **modificationDate**(): [`PdfDateTime`](../type-aliases/PdfDateTime) \| `null`

Gets or sets the date and time when the embedded file was last modified.

##### Returns

[`PdfDateTime`](../type-aliases/PdfDateTime) \| `null`

#### Set Signature

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

Gets or sets the date and time when the embedded file was last modified.

##### Parameters

###### value

[`PdfDateTime`](../type-aliases/PdfDateTime) | `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)

***

### size

#### Get Signature

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

Gets or sets the size of the embedded file, in bytes.

##### Returns

`number` \| `null`

#### Set Signature

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

Gets or sets the size of the embedded file, in bytes.

##### Parameters

###### value

`number` | `null`

##### Returns

`void`

## Methods

### 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)

***

### getStream()

> **getStream**(): `Uint8Array`\<`ArrayBufferLike`\> \| `null`

Gets the Uint8Array containing content of this EmbeddedFileStream,
stream should be disposed after usage.
NOTE! Method can return null if this EmbeddedFileStream is empty.

#### Returns

`Uint8Array`\<`ArrayBufferLike`\> \| `null`

***

### 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)
