# FileSpecification

## Content

# Class: FileSpecification

Represents a PDF File Specification.

The complex architecture of this class is based on the PDF Specification,
for full details please consult that spec.

## See

[FileSpecificationProperties](../type-aliases/FileSpecificationProperties)

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

```ts
new FileSpecification(om, properties): FileSpecification;
```

Creates a FileSpecification object on the base of properties specified by the
[FileSpecificationProperties](../type-aliases/FileSpecificationProperties).

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### properties

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

The properties of created object.

#### Returns

`FileSpecification`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new FileSpecification(properties): FileSpecification;
```

Creates a FileSpecification object on the base of properties specified by the
[FileSpecificationProperties](../type-aliases/FileSpecificationProperties).

#### Parameters

##### properties

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

The properties of created object.

#### Returns

`FileSpecification`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new FileSpecification(
   om, 
   fileName, 
   stream, 
   desc?): FileSpecification;
```

Creates a FileSpecification associated with the specified [EmbeddedFileStream](EmbeddedFileStream) object.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### fileName

`string`

The file name used as a name for embedded file.

##### stream

[`EmbeddedFileStream`](EmbeddedFileStream)

The [EmbeddedFileStream](EmbeddedFileStream) associated with created file specification.

##### desc?

`string`

The optional description.

#### Returns

`FileSpecification`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new FileSpecification(
   fileName, 
   stream, 
   desc?): FileSpecification;
```

Creates a FileSpecification associated with the specified [EmbeddedFileStream](EmbeddedFileStream) object.

#### Parameters

##### fileName

`string`

The file name used as a name for embedded file.

##### stream

[`EmbeddedFileStream`](EmbeddedFileStream)

The [EmbeddedFileStream](EmbeddedFileStream) associated with created file specification.

##### desc?

`string`

The optional description.

#### Returns

`FileSpecification`

#### Overrides

```ts
ObjectBase.constructor
```

## Accessors

### desc

#### Get Signature

```ts
get desc(): string;
```

Gets or sets the description of this File Specification.

##### Returns

`string`

#### Set Signature

```ts
set desc(value): void;
```

Gets or sets the description of this File Specification.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### dosFile

#### Get Signature

```ts
get dosFile(): FileInfo;
```

Gets the [FileInfo](FileInfo) object defining information about the referenced file for the DOS platform.
NOTE: Using this property is not recommended beginning with PDF 1.7.

##### Returns

[`FileInfo`](FileInfo)

***

### file

#### Get Signature

```ts
get file(): FileInfo;
```

Gets the [FileInfo](FileInfo) object that specifies information about a referenced file.
Note that this property should be used for files with names containing ASCII characters only,
and is provided for backwards compatibility. For file names that contain non-ASCII characters,
[unicodeFile](#unicodefile) should be used instead.

##### See

[unicodeFile](#unicodefile)

##### Returns

[`FileInfo`](FileInfo)

***

### fileSystem

#### Get Signature

```ts
get fileSystem(): string;
```

Gets or sets the file system to be used to interpret this file specification.

If this property is present, all other properties are interpreted by the designated file system.
PDF defines only one standard file system name, URL;
an application or plug-in extension can register other names.

##### Returns

`string`

#### Set Signature

```ts
set fileSystem(value): void;
```

Gets or sets the file system to be used to interpret this file specification.

If this property is present, all other properties are interpreted by the designated file system.
PDF defines only one standard file system name, URL;
an application or plug-in extension can register other names.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### hasEmbeddedFileStream

#### Get Signature

```ts
get hasEmbeddedFileStream(): boolean;
```

Gets a value indicating that this file specification has at least one
[EmbeddedFileStream](EmbeddedFileStream) associated with it.

##### Returns

`boolean`

***

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### ID

#### Get Signature

```ts
get ID(): FileID;
```

Gets or sets the [FileID](../type-aliases/FileID) object specifying the ID of the referenced file.

This property improves an application's chances of finding the intended file and allows it to warn
the user if the file has changed since the link was made.

##### Returns

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

#### Set Signature

```ts
set ID(value): void;
```

Gets or sets the [FileID](../type-aliases/FileID) object specifying the ID of the referenced file.

This property improves an application's chances of finding the intended file and allows it to warn
the user if the file has changed since the link was made.

##### Parameters

###### value

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

##### Returns

`void`

***

### macFile

#### Get Signature

```ts
get macFile(): FileInfo;
```

Gets the [FileInfo](FileInfo) object defining information about the referenced file for the Mac OS platform.
NOTE: Using this property is not recommended beginning with PDF 1.7.

##### Returns

[`FileInfo`](FileInfo)

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### relationship

#### Get Signature

```ts
get relationship(): string;
```

Gets or sets a value that represents the relationship of this object
to the source that points to it.
The [FileSpecificationRelationshipType](../variables/FileSpecificationRelationshipType) defines values from PDF specification.

##### Returns

`string`

#### Set Signature

```ts
set relationship(value): void;
```

Gets or sets a value that represents the relationship of this object
to the source that points to it.
The [FileSpecificationRelationshipType](../variables/FileSpecificationRelationshipType) defines values from PDF specification.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### unicodeFile

#### Get Signature

```ts
get unicodeFile(): FileInfo;
```

Gets the [FileInfo](FileInfo) object that specifies information about a referenced file.

##### See

[file](#file)

##### Returns

[`FileInfo`](FileInfo)

***

### unixFile

#### Get Signature

```ts
get unixFile(): FileInfo;
```

Gets the [FileInfo](FileInfo) object defining information about the referenced file for the Unix platform.
NOTE: Using this property is not recommended beginning with PDF 1.7.

##### Returns

[`FileInfo`](FileInfo)

***

### volatile

#### Get Signature

```ts
get volatile(): boolean;
```

Gets or sets a value indicating whether the file referenced by the file specification is volatile
(changes frequently with time). If the value is true, applications should never cache a copy of the file.

##### Returns

`boolean`

#### Set Signature

```ts
set volatile(value): void;
```

Gets or sets a value indicating whether the file referenced by the file specification is volatile
(changes frequently with time). If the value is true, applications should never cache a copy of the file.

##### Parameters

###### value

`boolean`

##### Returns

`void`

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

***

### getStream()

```ts
getStream(): Uint8Array<ArrayBufferLike>;
```

Gets a value indicating that this file specification has at least one
[EmbeddedFileStream](EmbeddedFileStream) associated with it.

#### Returns

`Uint8Array`&lt;`ArrayBufferLike`&gt;

***

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