Skip to content
Open
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
60 changes: 60 additions & 0 deletions common-information/clear-output-stream-on-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Automatic Output Stream Clearing on Export
description: The Export methods of all format providers automatically clear the output stream before writing, preventing corrupted documents when reusing streams.
page_title: Automatic Output Stream Clearing on Export
slug: common-export-output-stream-clearing
tags: export, stream, clear, format, provider, document, processing
published: True
position: 0
---

# Automatic Output Stream Clearing on Export

|Minimum Version|Q2 2026|
|----|----|

As of Q2 2026, the **Export()** methods of all [format providers]({%slug introduction%}#supported-formats) in the Telerik Document Processing Libraries automatically clear the output stream before writing new content. When the **Export()** method is called on a seekable stream, the stream is truncated to zero length prior to writing, ensuring that no stale data remains.

## Behavioral Change

When reusing a **Stream** for multiple consecutive export operations, for example, exporting to a **MemoryStream** or a **FileStream** opened with `FileMode.OpenOrCreate`, the previously written content could remain at the tail of the stream if the new document was smaller than the old one. This caused corrupted output files because trailing bytes from the earlier export persisted after the new export completed.

The stream clearing is now performed automatically by the base classes that all format providers inherit from. The affected format providers include:

| Library | Format Providers |
|---|---|
| RadPdfProcessing | **PdfFormatProvider**, **SkiaImageFormatProvider** |
| RadWordsProcessing | **DocxFormatProvider**, **DocFormatProvider**, **RtfFormatProvider**, **HtmlFormatProvider**, **TxtFormatProvider**, **PdfFormatProvider** |
| RadSpreadProcessing | **XlsxFormatProvider**, **XlsFormatProvider**, **XlsmFormatProvider**, **CsvFormatProvider**, **TxtFormatProvider**, **PdfFormatProvider**, **JsonFormatProvider** |

>note The stream is cleared only when **Stream.CanSeek** returns `true`. Non-seekable streams (such as network streams) are not affected and continue to behave as before.

No code changes are required on the consumer side. The clearing happens automatically inside the **Export()** methods.

## Using the Export Methods with Reused Streams

#### Example 1: Reusing a MemoryStream for multiple exports

<snippet id='reuse-stream-for-multiple-exports'/>

When reusing a stream, the second **Export()** call truncates the stream to zero length before writing, so only the new document data is present.

#### Example 2: Exporting to a FileStream

<snippet id='export-to-filestream'/>

Even when opening the file with `FileMode.OpenOrCreate`, the stream is cleared automatically so no leftover data from a previous file remains.

>tip If you open a **FileStream** with `FileMode.Create`, the file is already truncated by the OS, so the automatic clearing has no additional effect in that scenario.

## Backward Compatibility

>important This is a **behavioral change** in existing **Export()** methods. Code that intentionally preserves prior stream content before calling **Export()** is affected. The stream is now always truncated before writing. If you need to prepend content, write it after the export completes, or use a separate stream and combine them afterward.

For the majority of usage scenarios, where the stream is either freshly created or being reused for a new export, this change is transparent and prevents potential file corruption.

## See Also

* [Using PdfFormatProvider in RadPdfProcessing]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%})
* [Using DocxFormatProvider in RadWordsProcessing]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%})
* [Timeout Mechanism in Document Processing Libraries]({%slug timeout-mechanism-in-dpl%})
56 changes: 49 additions & 7 deletions getting-started/Installation/install-nuget-packages.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,62 @@
---
title: Install using NuGet Packages
page_title: Install using NuGet Packages
description: Learn how you can install the Telerik Document Processing libraries through NuGet.
title: Installing NuGet Packages
page_title: Install Telerik Document Processing Libraries via NuGet Packages
description: Install the Telerik Document Processing libraries from NuGet.org, the Telerik NuGet server, or a local feed. Includes setup steps for Visual Studio and .NET CLI.
slug: installation-nuget-packages
tags: nuget, document, processing, install, server, manual, download
tags: nuget, document, processing, install, server, manual, download, package
published: True
position: 7
---

# Install using NuGet Packages

This article describes how you can install the Document Processing Libraries using a NuGet package.
You can find all Document Processing Libraries packages in the [Available NuGet Packages]({%slug available-nuget-packages%}) article. There are two ways for getting the NuGet packages:
You can find all Document Processing Libraries packages in the [Available NuGet Packages]({%slug available-nuget-packages%}) article. There are three ways to get the NuGet packages:

* [Download from NuGet.org (Recommended)](#download-from-nugetorg)

* [Manually download the packages](#manually-download-nuget-packages)

* [Get the packages from the Telerik NuGet server](#download-from-the-nuget-server)

## Download from NuGet.org

As of **Q2 2026**, the Telerik Document Processing NuGet packages are available on <a href="https://www.nuget.org/" target="_blank">NuGet.org</a>. This is the recommended way to install the libraries because NuGet.org is the default package source in Visual Studio and the .NET CLI, so no additional feed configuration is required.

### Install through the Visual Studio NuGet Package Manager

1\. In the Visual Studio Solution Explorer, right-click a project and select **Manage NuGet Packages...**.

2\. Make sure the **Package source** dropdown is set to **nuget.org** (this is the default).

3\. In the **Browse** tab, search for the desired Telerik Document Processing package, for example, `Telerik.Documents.Fixed`.

4\. Select the package and click **Install**.

### Install through the .NET CLI

Run the following command in a terminal, replacing `Telerik.Documents.Fixed` with the name of the package you need:

```
dotnet add package Telerik.Documents.Fixed
```

The .NET CLI resolves packages from NuGet.org by default. You can install a specific version by appending the `--version` parameter:

```
dotnet add package Telerik.Documents.Fixed --version 2024.3.1015
```

### Install through the Package Manager Console

Run the following command in the Visual Studio **Package Manager Console**:

```
Install-Package Telerik.Documents.Fixed
```

>tip You can find the exact package names and available versions for all Document Processing Libraries in the [Available NuGet Packages]({%slug available-nuget-packages%}) article.

## Manually Download NuGet Packages

This approach allows you to setup a local NuGet package source, so you can install the Telerik products without an active Internet connection and without setting up our private feed.
Expand All @@ -40,9 +80,11 @@ This approach allows you to setup a local NuGet package source, so you can insta

![install-using-nuget003](images/install-using-nuget003.png)

## Download from the NuGet server
## Download from the NuGet Server

>note As of Q2 2026, NuGet.org is the recommended source for Telerik Document Processing packages. The Telerik NuGet server remains available for backward compatibility and for installing older versions that predate the NuGet.org release.

To install the Telerik Document Processing Libraries, you can use the NuGet packages hosted on the public Telerik NuGet server. This online source lets you download and install various versions of the Document Processing libraries and enables quick updates with minimal manual intervention.
To install the Telerik Document Processing Libraries, you can use the NuGet packages hosted on the Telerik NuGet server. This online source lets you download and install various versions of the Document Processing libraries and enables quick updates with minimal manual intervention.

Before adding the Telerik NuGet server to Visual Studio, make sure you have:

Expand Down
1 change: 1 addition & 0 deletions introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Telerik Document Processing features the following libraries:
|**Timeout Mechanism**|[Timeout Mechanism]({%slug timeout-mechanism-in-dpl%}) for importing and exporting documents. The **Import** and **Export** methods of all FormatProviders have a mandatory *TimeSpan?* timeout parameter after which the operation will be cancelled.|
|**GenAI-powered Document Insights**|Enables you to easily extract insights from PDF documents using Large Language Models (LLMs). This functionality enables you to summarize document content and ask questions about it, with the AI providing relevant answers based on the document's content. [[Read More]]({%slug radpdfprocessing-features-gen-ai-powered-document-insights-overview%})|
|**AI Coding Assistant**|Provides specialized context to AI models, enabling them to produce higher-quality code samples. [[Read More]]({%slug ai-coding-assistant%})|
|**Automatic Output Stream Clearing on Export**|Automatically clears the output stream before writing new content. [[Read More]]({%slug common-export-output-stream-clearing%})|

For more details about the benefits of using Telerik Document Processing, see the [Telerik Document Processing product overview page](https://www.telerik.com/document-processing-libraries).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Learn what are the limitations related to the usage of digital sign
page_title: Limitations
slug: radpdfprocessing-features-digital-signature-limitations
tags: digital, signature, limitations
position: 5
position: 7
---

# Limitations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: The digital signature feature enables you to sign and validate a PD
page_title: Signature Validation
slug: radpdfprocessing-features-digital-signature-validation
tags: digital, signature, validate
position: 4
position: 6
---

## Validating a Signature
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Signing Existing Signature Fields
description: Learn how to sign multiple pre-existing signature fields in a PDF document using incremental updates with the PdfStreamSigner class in RadPdfProcessing.
page_title: Signing Existing Signature Fields
slug: radpdfprocessing-features-signing-existing-signature-fields
tags: pdf, processing, digital, signature, signing, incremental, update, field
published: True
position: 5
---

# Signing Existing Signature Fields

|Minimum Version|Q2 2026|
|----|----|

**RadPdfProcessing** enables you to sign multiple pre-existing signature fields in a PDF document while preserving the validity of previously applied signatures. The `PdfStreamSigner` class applies each signature through an *incremental update*, which appends data to the original PDF instead of rewriting it. This approach ensures that each subsequent signature does not invalidate earlier ones.

PDF documents often contain multiple unsigned signature fields, for example, a contract that requires approval from several parties. When you sign these fields one at a time, each signing operation must preserve the integrity of all previous signatures. The `SignExistingField` method of the `PdfStreamSigner` class addresses this requirement. It locates a pre-existing signature field by name, applies a digital signature, and writes the result as an incremental update to the output stream. You can chain multiple signing operations by feeding the output of one step as the input to the next.

## API Reference

The following table lists the `SignExistingField` method overloads available on the `PdfStreamSigner` class.

| Method signature | Description |
|---|---|
| `SignExistingField(Stream originalStream, string fieldName, Signature signature)` | Signs an existing signature field identified by `fieldName` in the PDF document from `originalStream`. Uses incremental update to preserve previously applied signatures. |
| `SignExistingField(Stream originalStream, string fieldName, Signature signature, FormSource appearance)` | Signs an existing signature field and replaces the widget visual appearance with the specified `FormSource` content. Pass `null` for `appearance` to preserve the existing appearance. |

The following table describes the parameters accepted by the `SignExistingField` method.

| Parameter | Type | Description |
|---|---|---|
| `originalStream` | `Stream` | The stream that contains the current PDF document. |
| `fieldName` | `string` | The name of the pre-existing signature field to sign. |
| `signature` | `Signature` | The digital signature to apply to the field. |
| `appearance` | `FormSource` | The visual appearance to set on the signature widget. Pass `null` to keep the existing appearance. Available only in the overload that accepts a `FormSource` parameter. |

## Signing Existing Fields

To sign multiple existing signature fields in a PDF document:

1. Import the PDF and identify the unsigned signature fields by name.
2. Create a `PdfStreamSigner` instance with an output stream.
3. Call `SignExistingField` for each field, passing the current document stream and the field name.
4. Use the output stream from each step as the input for the next signing operation.

#### Example 1: Import a PDF and Sign All Signature Fields

The following example imports an existing PDF that contains unsigned signature fields and signs each field sequentially using incremental updates.

<snippet id='pdf-signature-sign-all-signature-fields'/>

The code first imports the document to discover the names of all unsigned `SignatureField` instances. It then iterates over the field names and calls `SignExistingField` for each one. Because each call produces an incremental update, previously applied signatures remain valid in the final output.

## Signing with Custom Appearance

When a PDF contains empty (unsigned) signature fields, you can generate and apply a visual appearance during signing. Create a `FormSource`, draw content into it with `FixedContentEditor`, and pass it to the `SignExistingField` overload that accepts an `appearance` parameter. Each signing step produces an incremental update, so previously applied signatures remain valid.

#### Example 2: Sign Existing Fields with Custom Appearance

The following example signs two signature fields and applies a custom visual appearance to each widget at signing time.

<snippet id='pdf-signature-sign-signature-fields-with-appearance'/>

The helper method below builds a visual appearance that displays the signer name, role, and signing date:

<snippet id='pdf-signature-build-appearance'/>

Each call to `SignExistingField` with a `FormSource` replaces the widget appearance of the target field. Pass `null` for the `appearance` parameter to preserve the existing widget appearance.

## See Also

* [Digital Signature in RadPdfProcessing]({%slug radpdfprocessing-features-digital-signature%})
* [Interactive Forms]({%slug radpdfprocessing-model-interactive-forms-form-fields%})
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ The resulting document can be opened in any application that supports PDF docume
* [PdfFormatProvider API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.html)
* [Settings]({%slug radpdfprocessing-formats-and-conversion-pdf-settings%})
* [Timeout Mechanism]({%slug timeout-mechanism-in-dpl%})
* [Automatic Output Stream Clearing on Export]({%slug common-export-output-stream-clearing%})
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ __Example 1__ shows how to use __TextFormatProvider__ to export __RadFixedDocume
* [Timeout Mechanism]({%slug timeout-mechanism-in-dpl%})
* [Extracting Text from PDF Documents]({%slug extract-text-from-pdf%})
* [Summarizing the Text Content of PDF Documents using Text Analytics with Azure AI services]({%slug summarize-pdf-content%})
* [Automatic Output Stream Clearing on Export]({%slug common-export-output-stream-clearing%})
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Calculation Chain (Reference Map)
description: Learn how the calculation chain in RadSpreadProcessing optimizes formula recalculation by tracking cell dependencies and computing formulas in the correct order.
page_title: Calculation Chain (Reference Map) - RadSpreadProcessing
slug: radspreadprocessing-features-calculation-chain
tags: spread, processing, formulas, calculation, performance, dependency, recalculation
published: True
position: 6
---

# Calculation Chain (Reference Map)

|Minimum Version|Q2 2026|
|----|----|

**RadSpreadProcessing** uses a *calculation chain* (also known as a *reference map*) to track how formula cells depend on one another and to recalculate them in the optimal order. The calculation chain activates automatically when you work with a `Workbook` that contains formulas — no additional API calls are required.

## How the Calculation Chain Works

When a cell value changes, **RadSpreadProcessing** needs to recalculate every formula that directly or indirectly references that cell. The calculation chain maintains a directed dependency graph of all formula cells in the workbook. The library uses this graph to determine the minimal set of formulas that require recalculation and the correct order in which to evaluate them.

The calculation chain covers the following scenarios:

* Opening a spreadsheet document populates the calculation chain from the existing formulas.
* Setting or changing a cell formula updates the dependency graph.
* Changing a cell value triggers recalculation of only the dependent formulas identified by the chain.

>tip The calculation chain is an internal optimization. You do not need to create or manage it in your code - **RadSpreadProcessing** handles the dependency tracking and recalculation automatically.

## Key Benefits

The calculation chain addresses common performance issues when you work with workbooks that contain many complex or interdependent formulas:

* **Optimal recalculation order** — Formulas recalculate in topological dependency order, which prevents redundant evaluations and ensures that each formula reads up-to-date input values.
* **Minimal recalculation scope** — Only the formulas affected by a change recalculate, instead of re-evaluating every formula in the workbook.
* **Faster import of formula-heavy documents** — Documents with large numbers of formulas that reference wide cell ranges import faster because the evaluation is dependency-driven.

## Performance Considerations

When you modify cell values or formulas in bulk, use the `SuspendLayoutUpdate` and `ResumeLayoutUpdate` methods on the `Workbook` to avoid triggering layout recalculations on every individual change.

#### Example 1: Batch-modify cell values with suspended layout updates

<snippet id='calculation-chain-batch-modify-suspended-layout'/>

The `SuspendLayoutUpdate` method prevents the workbook from recalculating its layout on each cell change. Call `ResumeLayoutUpdate` after you finish the batch to trigger a single layout pass.

## See Also

* [Cell value types in RadSpreadProcessing]({%slug radspreadprocessing-features-cell-value-types%})
* [Formulas overview in RadSpreadProcessing]({%slug radspreadprocessing-features-formulas-general-information%})
* [Performance tips for RadSpreadProcessing]({%slug radspreadprocessing-performance%})
* [Workbook API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.Model.Workbook.html)
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ __Example 2__ demonstrates how to export an existing Workbook to a CSV file. The
* [CsvFormatProvider API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Spreadsheet.FormatProviders.TextBased.Csv.CsvFormatProvider.html)
* [Import/Load and Export/Save RadSpreadProcessing Workbook]({%slug import-export-save-load-workbook%})
* [Timeout Mechanism]({%slug timeout-mechanism-in-dpl%})
* [Automatic Output Stream Clearing on Export]({%slug common-export-output-stream-clearing%})
Loading