Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions ai-tools/agent-tools/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ Access to the Telerik Document Processing Agent Tools depends on your [Telerik l

The Agent Tools API provides foundational types that enable document management and tool creation across all document types:

- **AgentToolBase**: Base class for all agent tool classes. Provides an abstract foundation for creating AI-exposable tools within the Telerik Documents AI tooling ecosystem. It enables automatic discovery and conversion of specially annotated instance methods into AITool objects that can be consumed by AI frameworks.

- **IDocumentRepository**: Base interface for all document repositories. A repository is an in-memory container where documents are stored and managed during processing. It provides operations to import and export documents and retrieve them via unique identifiers.

- **IDocumentRepository<TDocument>**: Generic interface that extends IDocumentRepository to provide type-specific document management. Defines a consistent abstraction for managing documents across different file types (spreadsheets, PDFs, flow documents). Each repository explicitly reports the DocumentType it manages, allowing the system to route operations to the correct repository based on file type.

- **DocumentRepositoryRegistry**: A centralized registry that maintains one repository for each document type (Workbook, Fixed, and Flow). Enables higher-level components to dynamically resolve the appropriate repository at runtime based on the document type being handled.
| Type | Description |
|---|---|
| `AgentToolBase` | Base class for all agent tool classes. Provides an abstract foundation for creating AI-exposable tools within the Telerik Documents AI tooling ecosystem. It enables automatic discovery and conversion of specially annotated instance methods into `AITool` objects that can be consumed by AI frameworks. |
| `IDocumentRepository` | Base interface for all document repositories. A repository is an in-memory container where documents are stored and managed during processing. It provides operations to import and export documents and retrieve them via unique identifiers. |
| `IDocumentRepository<TDocument>` | Generic interface that extends `IDocumentRepository` to provide type-specific document management. Defines a consistent abstraction for managing documents across different file types (spreadsheets, PDFs, flow documents). Each repository explicitly reports the `DocumentType` it manages, allowing the system to route operations to the correct repository based on file type. |
| `DocumentRepositoryRegistry` | A centralized registry that maintains one repository for each document type (Workbook, Fixed, and Flow). Enables higher-level components to dynamically resolve the appropriate repository at runtime based on the document type being handled. |

## Available Tools

Expand All @@ -52,11 +51,11 @@ The Agent Tools API provides optional dependency injection support for applicati

The following extension methods are available for registering agent tools with IServiceCollection:

- **services.AddSpreadsheetAgentTools()**: Registers all spreadsheet agent tool classes (SpreadProcessingReadAgentTools, SpreadProcessingWriteAgentTools, SpreadProcessingWorksheetAgentTools, SpreadProcessingFileManagementAgentTools, and SpreadProcessingFormulaAgentTools) and their required dependencies, including the appropriate workbook repository.
- **services.AddFixedAgentTools()**: Registers all fixed document agent tool classes (FixedDocumentFormAgentTools, FixedDocumentContentAgentTools, and FixedFileManagementAgentTools) and their required dependencies, including the fixed document repository.
- **services.AddFlowAgentTools()**: Registers flow document repositories and related services for use with conversion and merge operations.
| Method | Description |
|---|---|
| `AddSpreadsheetAgentTools()` | Registers all spreadsheet agent tool classes (`SpreadProcessingReadAgentTools`, `SpreadProcessingWriteAgentTools`, `SpreadProcessingWorksheetAgentTools`, `SpreadProcessingFileManagementAgentTools`, and `SpreadProcessingFormulaAgentTools`) and their required dependencies, including the appropriate workbook repository. |
| `AddFixedAgentTools()` | Registers all fixed document agent tool classes (`FixedDocumentFormAgentTools`, `FixedDocumentContentAgentTools`, and `FixedFileManagementAgentTools`) and their required dependencies, including the fixed document repository. |
| `AddFlowAgentTools()` | Registers flow document repositories and related services for use with conversion and merge operations. |

## See Also

Expand Down
48 changes: 27 additions & 21 deletions common-information/device-independent-pixels.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,35 @@ tags: dip, pixels, measurement, unit, radspreadprocessing, radpdfprocessing, rad
The [UnitHelper](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.spreadsheet.utilities.unithelper) class provides a bunch of methods for converting from DIPs to other measurement units and vice versa (e.g. points, picas, centimeters, inches, etc.).

#### Convert From Dip to Unit:
* **DipToPoint**: Converts dips to points.
* **DipToPointI**: Converts dips to points.
* **DipToPica**: Converts dips to picas.
* **DipToCm**: Converts dips to centimeters.
* **DipToMm**: Converts dips to millimeters.
* **DipToInch**: Converts dips to inches.
* **DipToTwip**: Converts dips to twips.
* **DipToEmu**: Converts dips to EMUs.
* **DipToTwipI**: Converts dips to twips.
* **DipToTwipF**: Converts dips to twips.
* **DipToUnit**: Converts DIPs to units.

| Method | Description |
|---|---|
| `DipToPoint` | Converts dips to points. |
| `DipToPointI` | Converts dips to points. |
| `DipToPica` | Converts dips to picas. |
| `DipToCm` | Converts dips to centimeters. |
| `DipToMm` | Converts dips to millimeters. |
| `DipToInch` | Converts dips to inches. |
| `DipToTwip` | Converts dips to twips. |
| `DipToEmu` | Converts dips to EMUs. |
| `DipToTwipI` | Converts dips to twips. |
| `DipToTwipF` | Converts dips to twips. |
| `DipToUnit` | Converts DIPs to units. |

#### Convert From Unit to Dip:
* **PointToDip**: Converts points to dips.
* **PicaToDip**: Converts picas to dips.
* **EmuToDip**: Converts EMUs to dips.
* **CmToDip**: Converts centimeters to dips.
* **MmToDip**: Converts millimeters to dips.
* **InchToDip**: Converts inches to dips.
* **TwipToDip**: Converts twips to dips.
* **TwipToDipF**: Converts twips to dips.
* **TwipToDipI**: Converts twips to dips.
* **UnitToDip**: Converts Units to dips.

| Method | Description |
|---|---|
| `PointToDip` | Converts points to dips. |
| `PicaToDip` | Converts picas to dips. |
| `EmuToDip` | Converts EMUs to dips. |
| `CmToDip` | Converts centimeters to dips. |
| `MmToDip` | Converts millimeters to dips. |
| `InchToDip` | Converts inches to dips. |
| `TwipToDip` | Converts twips to dips. |
| `TwipToDipF` | Converts twips to dips. |
| `TwipToDipI` | Converts twips to dips. |
| `UnitToDip` | Converts Units to dips. |

Most of the methods follow the same pattern for converting units:

Expand Down
8 changes: 5 additions & 3 deletions knowledge-base/pdf-invisible-signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ The invisible signature is created by not setting the size to the signature widg

**RadPdfProcessing** offers the ability to set the signature flags. The possible values are as specified in the PDF Standard:

* **None**: The document does not contain signatures.
* **SignaturesExist**: If set, the document contains at least one signature field.
* **AppendOnly**: The document contains signatures that may be invalidated if the file is saved in a way that alters its previous contents.
| Value | Description |
|---|---|
| `None` | The document does not contain signatures. |
| `SignaturesExist` | If set, the document contains at least one signature field. |
| `AppendOnly` | The document contains signatures that may be invalidated if the file is saved in a way that alters its previous contents. |

With this functionality, you can specify that there is a signature, even if the signature itself does not have a visual representation. For example, you can create a signature without visible content (empty widget) and set the flags like with the following code:

Expand Down
7 changes: 4 additions & 3 deletions libraries/radpdfprocessing/concepts/cmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ After registering the **PredefinedCMapsProvider** class, you will be able to imp

The deafult implementation covers the majority of the scenarios but in some pretty rare cases, users might need to provide a custom CMap. The API enables you also create a custom implementation for a CMap provider so you can provide the data for the custom CMap table. To achieve that, you will need to inherit the **PredefinedCMapsProviderBase** abstract class and implement the following members:

* **byte[] GetCidCMapData(string name)**: Used to retrieve the *character code to CID mapping* of a predefined CMap. It should return the the CMap resource data depending on the specified name.

* **byte[] GetUnicodeCMapData(string name)**: Used to retrieve the *character code to Unicode mapping* of a predefined CMap. It should return the the CMap resource data depending on the specified name.
| Member | Description |
|---|---|
| `byte[] GetCidCMapData(string name)` | Retrieves the *character code to CID mapping* of a predefined CMap. Returns the CMap resource data for the specified name. |
| `byte[] GetUnicodeCMapData(string name)` | Retrieves the *character code to Unicode mapping* of a predefined CMap. Returns the CMap resource data for the specified name. |

## See Also
* [FontsRepository](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.html)
Expand Down
92 changes: 43 additions & 49 deletions libraries/radpdfprocessing/concepts/colors-and-color-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ The simple colors represent colors, which are defined with color components. The

### RgbColor

Represents an ARGB (alpha, red, green, blue) color. The RgbColor class exposes the following properties:

* __A__: The alpha component value.
* __R__: The red component value.
* __G__: The green component value.
* __B__: The blue component value.
Represents an ARGB (alpha, red, green, blue) color. The RgbColor class exposes the following properties:

| Property | Description |
|---|---|
| `A` | The alpha component value. |
| `R` | The red component value. |
| `G` | The green component value. |
| `B` | The blue component value. |

__Example 1__ demonstrates how you can create an RgbColor and assign it as Fill of a [Path]({%slug radpdfprocessing-model-path%}) element.

Expand All @@ -41,10 +43,12 @@ __Example 1__ demonstrates how you can create an RgbColor and assign it as Fill

Represents a CMYK (cyan, magenta, yellow, key) color. The CmykColor class was introduced in **Q4 2024** and it exposes the following properties:

* **C**: The cyan component of the color, a value between 0.0 and 1.0.
* **M**: The magenta component of the color, a value between 0.0 and 1.0.
* **Y**: The yellow component of the color, a value between 0.0 and 1.0.
* **K**: The key (black) component of the color, a value between 0.0 and 1.0.
| Property | Description |
|---|---|
| `C` | The cyan component of the color, a value between 0.0 and 1.0. |
| `M` | The magenta component of the color, a value between 0.0 and 1.0. |
| `Y` | The yellow component of the color, a value between 0.0 and 1.0. |
| `K` | The key (black) component of the color, a value between 0.0 and 1.0. |

#### Create CmykColor

Expand All @@ -60,19 +64,16 @@ The abstract __PatternColor__ class represents colors, which are defined with th

### Gradient

Gradient provides a smooth transition between colors across an area which is painted. The gradient color is represented by the __Gradient__ abstract class which exposes the following properties:

* __StartPoint__: A __Point__ object representing the starting two-dimensional coordinates of the gradient.

* __EndPoint__: A __Point__ object representing the ending two-dimensional coordinates of the gradient.

* __ExtendBefore__: Specifies whether to extend the gradient beyond the starting point.
Gradient provides a smooth transition between colors across an area which is painted. The gradient color is represented by the __Gradient__ abstract class which exposes the following properties:

* __ExtendAfter__: Specifies whether to extend the gradient beyond the ending point.

* __Background__: __SimpleColor__ object representing the background color.

* __GradientStops__: A collection of [GradientStop](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.ColorSpaces.GradientStop.html) objects representing the gradient stops collection.
| Property | Description |
|---|---|
| `StartPoint` | A `Point` object representing the starting two-dimensional coordinates of the gradient. |
| `EndPoint` | A `Point` object representing the ending two-dimensional coordinates of the gradient. |
| `ExtendBefore` | Specifies whether to extend the gradient beyond the starting point. |
| `ExtendAfter` | Specifies whether to extend the gradient beyond the ending point. |
| `Background` | A `SimpleColor` object representing the background color. |
| `GradientStops` | A collection of [GradientStop](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.ColorSpaces.GradientStop.html) objects representing the gradient stops. |

The __Gradient__ class is inherited by the following classes:

Expand All @@ -90,45 +91,38 @@ The gradient created in __Example 2__ is shown in __Figure 1__.

![Rad Pdf Processing Concepts Colors And Color Spaces 01](images/RadPdfProcessing_Concepts_Colors_And_Color_Spaces_01.png)

* __RadialGradient__: Defines a blend between two circles, optionally extended beyond the boundary circles by continuing the boundary colors. The __RadialGradient__ class exposes the following properties:

* __RadialGradient__: Defines a blend between two circles, optionally extended beyond the boundary circles by continuing the boundary colors. The __RadialGradient__ class exposes the following additional properties:

* __StartRadius__: Decimal number determining the radius of the starting circle.
* __EndRadius__: Decimal number determining the radius of the ending circle.
| Property | Description |
|---|---|
| `StartRadius` | Decimal number determining the radius of the starting circle. |
| `EndRadius` | Decimal number determining the radius of the ending circle. |

__Example 3__ demonstrates how to create a RadialGradient and assing it as the FillColor of a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}).
__Example 3__ demonstrates how to create a RadialGradient and assing it as the FillColor of a [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}).

#### __Example 3: Create RadialGradient__
#### __Example 3: Create RadialGradient__

<snippet id='pdf-create-linear-gradient'/>
<snippet id='pdf-create-linear-gradient'/>

The result from __Example 3__ is shown in __Figure 2__.
The result from __Example 3__ is shown in __Figure 2__.

#### Figure 2: RadialGradient
#### Figure 2: RadialGradient

![Rad Pdf Processing Concepts Colors And Color Spaces 03](images/RadPdfProcessing_Concepts_Colors_And_Color_Spaces_03.png)
![Rad Pdf Processing Concepts Colors And Color Spaces 03](images/RadPdfProcessing_Concepts_Colors_And_Color_Spaces_03.png)

### Tiling Pattern

A tiling pattern consists of a small graphical figure called a pattern cell. Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. The tiling pattern is represented by the __TilingBase__ abstract class, which exposes the following properties:


* __BoundingBox__: Property of type __Rect__ representing the dimensions pattern cell.

* __VerticalSpacing__: Decimal number determining the vertical spacing between pattern cells.

* __HorizontalSpacing__: Decimal number determining the horizontal spacing between pattern cells.

* __Size__: The size of the bounding box.

* __Content__: The collection of content elements inside a pattern cell.

* __Position__: The position of the tiling pattern.

* __TilingType__: Property of type [TilingType](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.ColorSpaces.TilingType.html) that represents the tiling type.The possible values are:
* __AllowSmallDistortion__: Pattern cells are spaces consistently. To achieve this, the pattern cell might be slightly distorted by making small adjustments to the __HorizontalSpacing__ and __VerticalSpacing__.
* __NoDistortion__: Pattern cells are not distorted, but the spacing between pattern cells may vary. This achieves the spacing requested by __HorizontalSpacing__ and __VerticalSpacing__ on average, but not necessarily for each individual pattern cell.
* __FastTiling__: Pattern cells are spaced consistently as in __AllowSmallDistortion__ type but with additional distortion permitted to enable a more efficient painting.
| Property | Description |
|---|---|
| `BoundingBox` | Of type `Rect`, representing the dimensions of the pattern cell. |
| `VerticalSpacing` | Decimal number determining the vertical spacing between pattern cells. |
| `HorizontalSpacing` | Decimal number determining the horizontal spacing between pattern cells. |
| `Size` | The size of the bounding box. |
| `Content` | The collection of content elements inside a pattern cell. |
| `Position` | The position of the tiling pattern. |
| `TilingType` | Of type [TilingType](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.ColorSpaces.TilingType.html), represents the tiling type. Possible values: `AllowSmallDistortion` (cells spaced consistently with slight distortion), `NoDistortion` (cells not distorted but spacing may vary), `FastTiling` (consistent spacing with additional distortion for efficient painting). |


The __TilingBase__ class is inherited from the following classes:
Expand Down
Loading