# Library Class

> Used to create a new instance of a library object or change properties.

- Product: Adobe PDF Library 21
- Language: .NET Framework
- Version: APDFL21.0.0PlusP1e
- HTML page: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/Library
- Version index: https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/llms.txt

```csharp
class Library : SystemIDisposable
```

**Namespace:** `Datalogics::PDFL`

**Inherits from:** `SystemIDisposable`

## Description

Used to create a new instance of a library object or change properties.

A Library object can be used to create a new instance of a library or change the properties of an existing library.

**Uses types:** [`ColorProfile`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/ColorProfile.md), [`LibraryFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/LibraryFlags.md), [`LogParams`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/class/LogParams.md), [`TempStoreType`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/TempStoreType.md)

## Constructors

### Library

```csharp
Datalogics.PDFL.Library.Library()
```

*constructor*

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

### Library

```csharp
Datalogics.PDFL.Library.Library(LibraryFlags flags)
```

*constructor*

**Parameters**

- `flags` ([`LibraryFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/LibraryFlags.md)): PDF Library initialization flags, optional

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

### Library

```csharp
Datalogics.PDFL.Library.Library(System.Collections.Generic.IList< System.String > fontPaths)
```

*constructor*

**Parameters**

- `fontPaths` (`System.Collections.Generic.IList< System.String >`): list of directories to search for fonts

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

### Library

```csharp
Datalogics.PDFL.Library.Library(System.Collections.Generic.IList< System.String > fontPaths, LibraryFlags flags)
```

*constructor*

**Parameters**

- `fontPaths` (`System.Collections.Generic.IList< System.String >`): list of directories to search for fonts
- `flags` ([`LibraryFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/LibraryFlags.md)): PDF Library initialization flags, optional

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

### Library

```csharp
Datalogics.PDFL.Library.Library(System.Collections.Generic.IList< System.String > fontPaths, string CMapPath, string UnicodePath, LibraryFlags flags)
```

*constructor*

**Parameters**

- `fontPaths` (`System.Collections.Generic.IList< System.String >`): list of directories to search for fonts
- `CMapPath` (`string`): directory to search for CMap files (pass an empty string to use the default)
- `UnicodePath` (`string`): directory to search for Unicode mapping files (pass an empty string to use the default)
- `flags` ([`LibraryFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/LibraryFlags.md)): PDF Library initialization flags, optional

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

### Library

```csharp
Datalogics.PDFL.Library.Library(System.Collections.Generic.IList< System.String > fontPaths, string CMapPath, string UnicodePath, string ColorProfilePath, LibraryFlags flags)
```

*constructor*

**Parameters**

- `fontPaths` (`System.Collections.Generic.IList< System.String >`): list of directories to search for fonts
- `CMapPath` (`string`): directory to search for CMap files (pass an empty string to use the default)
- `UnicodePath` (`string`): directory to search for Unicode mapping files (pass an empty string to use the default)
- `ColorProfilePath` (`string`): directory to search for Color Profile files (pass an empty string to use the default)
- `flags` ([`LibraryFlags`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/LibraryFlags.md)): PDF Library initialization flags, optional

Initialize the PDF Library on this thread. Note that each thread needs its own instance of the library.

Multiple Library objects can be created on a thread, but they all refer to the same underlying instantiation of the library.

## Properties

### APDFLVersion

```csharp
static string Datalogics.PDFL.Library.APDFLVersion { get; }
```

*static*

### AllowOpeningXFA

```csharp
bool Datalogics.PDFL.Library.AllowOpeningXFA { get; set; }
```

Allow opening PDF files that contain XFA forms. By default, an exception will be raised when attempting to open this type of document.

### AllowRelaxedSyntax

```csharp
bool Datalogics.PDFL.Library.AllowRelaxedSyntax { get; set; }
```

Check to see if minor parsing errors are ignored while opening PDF files.

### DLEVersion

```csharp
static string Datalogics.PDFL.Library.DLEVersion { get; }
```

*static*

### DefaultTempPath

```csharp
string Datalogics.PDFL.Library.DefaultTempPath { get; set; }
```

Gets the default temporary directory.

### DefaultTempStore

```csharp
TempStoreType Datalogics.PDFL.Library.DefaultTempStore { get; set; }
```

Gets default temporary storage. PDFL uses Disk storage type by default.

### DefaultTempStoreMemLimit

```csharp
int Datalogics.PDFL.Library.DefaultTempStoreMemLimit { get; set; }
```

Gets current memory limit.

### FormsExtensionVersion

```csharp
static string Datalogics.PDFL.Library.FormsExtensionVersion { get; }
```

*static*

### InstallLocation

```csharp
static string Datalogics.PDFL.Library.InstallLocation { get; }
```

*static*

### LicenseKey

```csharp
static string Datalogics.PDFL.Library.LicenseKey { get; set; }
```

*static*

### LogParams

```csharp
LogParams Datalogics.PDFL.Library.LogParams { get; set; }
```

Gets LogParams object with preferences for logging.

### ResourceDirectory

```csharp
static string Datalogics.PDFL.Library.ResourceDirectory { get; }
```

*static*

## Methods

### ChangeWorkingSpaceCMYK

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceCMYK(ColorProfile colorProfile)
```

**Parameters**

- `colorProfile` ([`ColorProfile`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/ColorProfile.md)): The Color Profile to be used.

**Returns:** `void`

Sets the current CMYK working space to the specified ICC profile.

### ChangeWorkingSpaceCMYK

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceCMYK(string profilePath)
```

**Parameters**

- `profilePath` (`string`): The path on disk of the Color Profile to be used.

**Returns:** `void`

Sets the current CMYK working space to the specified ICC profile.

### ChangeWorkingSpaceGray

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceGray(ColorProfile colorProfile)
```

**Parameters**

- `colorProfile` ([`ColorProfile`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/ColorProfile.md)): The Color Profile to be used.

**Returns:** `void`

Sets the current Gray working space to the specified ICC profile.

### ChangeWorkingSpaceGray

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceGray(string profilePath)
```

**Parameters**

- `profilePath` (`string`): The path on disk of the Color Profile to be used.

**Returns:** `void`

Sets the current Gray working space to the specified ICC profile.

### ChangeWorkingSpaceRGB

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceRGB(ColorProfile colorProfile)
```

**Parameters**

- `colorProfile` ([`ColorProfile`](https://docs.datalogics.com/apdfl21/DotNetFramework/APDFL21.0.0PlusP1e/enum/ColorProfile.md)): The Color Profile to be used.

**Returns:** `void`

Sets the current RGB working space to the specified ICC profile.

### ChangeWorkingSpaceRGB

```csharp
void Datalogics.PDFL.Library.ChangeWorkingSpaceRGB(string profilePath)
```

**Parameters**

- `profilePath` (`string`): The path on disk of the Color Profile to be used.

**Returns:** `void`

Sets the current RGB working space to the specified ICC profile.

### Dispose

```csharp
void Datalogics.PDFL.Library.Dispose()
```

**Returns:** `void`

### EnableLicensedBehavior

```csharp
static bool Datalogics.PDFL.Library.EnableLicensedBehavior(string arg0)
```

*static*

**Parameters**

- `arg0` (`string`): A base64-encoded string containing the encrypted license key.

**Returns:** `bool`

true if the licensed behavior has been successfully enabled.

This is used to turn on licensed behaviors in DLE.

The function parameter is a base64-encoded string containing the encrypted licensed key.

### Initialized

```csharp
static bool Datalogics.PDFL.Library.Initialized()
```

*static*

**Returns:** `bool`

true if the PDF Library is initialized on this thread

Check to see if the library is initialized

### IsFormsExtensionAvailable

```csharp
bool Datalogics.PDFL.Library.IsFormsExtensionAvailable()
```

**Returns:** `bool`

true if the Forms Extension dependencies are present, and false if they are not.

Validate the Forms Extension dependencies are present. Indicates if all of the necessary dependencies are present for the Forms extension.

### Terminate

```csharp
void Datalogics.PDFL.Library.Terminate()
```

**Returns:** `void`

Terminate the library with regard to this handle. (Note that if there are other Library objects in this thread, they may keep the library initialized.
