# Create

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Pdf/>

{% tabs %}
{% tab title="Parameter: FileProperties" %}

| Name                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `String`                      | <p>PDF document destination Directory.</p><p><br>Default: <code>C:\Output</code><br>Example: <code>F:\outputfiles</code></p>                                                                                                                                                                                                                                                                                                     |
| FileName : `String`                       | <p>Filename for created PDF file.</p><p><br>Default: <code>example\_file.pdf</code><br>Example: <code>output.pdf</code></p>                                                                                                                                                                                                                                                                                                      |
| FileExistsAction : `FileExistsActionEnum` | <p>What to do if destination file already exists.</p><p>Possible values:</p><ul><li><code>Error</code>:</li></ul><p>What to do if destination file already exists.</p><ul><li><code>Overwrite</code>:</li></ul><p>What to do if destination file already exists.</p><ul><li><code>Rename</code>:</li></ul><p>What to do if destination file already exists.</p><p><br>Default: <code>0</code><br>Example: <code>Error</code></p> |
| {% endtab %}                              |                                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% tab title="Parameter: DocumentSettings" %}

| Name                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title : `String`                    | <p>Optional PDF document title.</p><p><br>Default: <code>-</code><br>Example: <code>Very important document.</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Author : `String`                   | <p>Optional PDF document Author.</p><p><br>Default: <code>-</code><br>Example: <code>Erik Example</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Size : `PageSizeEnum`               | <p>Document page size.</p><p>Possible values:</p><ul><li><code>A0</code>:</li></ul><p>Document page size.</p><ul><li><code>A1</code>:</li></ul><p>Document page size.</p><ul><li><code>A2</code>:</li></ul><p>Document page size.</p><ul><li><code>A3</code>:</li></ul><p>Document page size.</p><ul><li><code>A4</code>:</li></ul><p>Document page size.</p><ul><li><code>A5</code>:</li></ul><p>Document page size.</p><ul><li><code>A6</code>:</li></ul><p>Document page size.</p><ul><li><code>B5</code>:</li></ul><p>Document page size.</p><ul><li><code>Ledger</code>:</li></ul><p>Document page size.</p><ul><li><code>Legal</code>:</li></ul><p>Document page size.</p><ul><li><code>Letter</code>:</li></ul><p>Document page size.</p><p><br>Default: <code>4</code><br>Example: <code>A4</code></p> |
| Orientation : `PageOrientationEnum` | <p>Page orientation.</p><p>Possible values:</p><ul><li><code>Portrait</code>:</li></ul><p>Page orientation.</p><ul><li><code>Landscape</code>:</li></ul><p>Page orientation.</p><p><br>Default: <code>0</code><br>Example: <code>Portrait</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| MarginLeftInCm : `Double`           | <p>Page margin left in CM.</p><p><br>Default: <code>2.5</code><br>Example: <code>2.5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| MarginTopInCm : `Double`            | <p>Page margin top in CM.</p><p><br>Default: <code>2</code><br>Example: <code>2</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| MarginRightInCm : `Double`          | <p>Page margin right in CM.</p><p><br>Default: <code>2.5</code><br>Example: <code>2.5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| MarginBottomInCm : `Double`         | <p>Page margin bottom in CM.</p><p><br>Default: <code>2</code><br>Example: <code>2</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

{% tab title="Parameter: DocumentContent" %}

| Name                              | Description                                                                                                      |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Contents : `PageContentElement[]` | <p>Document content.</p><p><br>Default: <code>-</code><br>Example: <code>Array of PageContentElements</code></p> |
| {% endtab %}                      |                                                                                                                  |

{% tab title="Parameter: Options" %}

| Name                            | Description                                                                                                                                                                                                                                                                                   |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean` | <p>True: Throws error on failure</p><p>False: Returns object{ Success = false }</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                        |
| CustomFontsLocation : `String`  | <p>Path to directory with fonts to use.</p><p>If empty, task will use default system locations</p><p>Otherwise, CustomFontsLocation will be used as well as default system locations, unless it does not exist.</p><p><br>Default: <code>-</code><br>Example: <code>C:\MyDir\fonts</code></p> |
| FallbackFontName : `String`     | <p>Font family name that will be used, if specific font couldn't be resolved.</p><p>Using Arial if nothing is provided.</p><p><br>Default: <code>-</code><br>Example: <code>Arial</code></p>                                                                                                  |
| {% endtab %}                    |                                                                                                                                                                                                                                                                                               |

{% tab title="Result: Result" %}

| Name                | Description                                                                                  |
| ------------------- | -------------------------------------------------------------------------------------------- |
| Success : `Boolean` | <p>Indicates if the operation was successful.<br>Example: <code>true</code></p>              |
| FileName : `String` | <p>Name of the file which was created.<br>Example: <code>C:\tmp\example\_file.pdf</code></p> |
| {% endtab %}        |                                                                                              |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-02-03

#### Changed

* \[Breaking Change] Upgrade to .net8.0
* \[Breaking Change] Remove the deprecated option to choose Unicode vs. ANSI text (Code is always Unicode now)

#### Added

* Add an option to set up custom fonts directory
* Add an option to set up default font
* Add support for Linux systems

#### Fixed

* Resolve issues with not responsive Windows GDI methods (Failing to get fonts)

### \[1.2.0] - 2026-02-03

#### Changed

* Rename task prefix from PDF to Pdf

### \[1.1.0] - 2024-08-23

#### Changed

* Updated the Newtonsoft.Json package to version 13.0.3.

### \[1.0.1] - 2023-03-01

#### Fixed

* Fixed document link to task portal.
* Added requirements to the summary.

### \[1.0.0] - 2022-05-10

#### Added

* Initial implementation of Frends.PDF.Create.
  {% endtab %}
  {% endtabs %}
