Skip to content

Commit a9b4e2e

Browse files
Merge pull request #499 from telerik/Q1_2025
Q1 2025
2 parents e065f50 + 6a43073 commit a9b4e2e

File tree

12 files changed

+248
-26
lines changed

12 files changed

+248
-26
lines changed

images/dpl-pdf.png

7.89 KB
Loading

images/dpl-spread.png

8.89 KB
Loading

images/dpl-words.png

9.68 KB
Loading

images/dpl-zip.png

7.31 KB
Loading

images/ninja_looking.png

7.12 KB
Loading

introduction.md

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ position: 0
1212
table th:first-of-type {
1313
width: 25%;
1414
}
15+
16+
img[alt$="><"] {
17+
display: block;
18+
max-width: 100%;
19+
height: auto;
20+
margin: auto;
21+
float: none!important;
22+
}
1523
</style>
1624

1725
# Welcome to Telerik Document Processing Libraries
@@ -26,15 +34,15 @@ table th:first-of-type {
2634

2735
## Libraries
2836

29-
Telerik Document Processing features the following components:
37+
Telerik Document Processing features the following libraries:
3038

3139
|Library|Description|
3240
|----|----|
33-
| [RadPdfProcessing]({%slug radpdfprocessing-overview%})|A processing library that allows you to create, import, and export PDF documents from your code. You can use it in any web or desktop .NET application without relying on third-party software like Adobe Acrobat.|
34-
|[RadSpreadProcessing]({%slug radspreadprocessing-overview%})|A powerful library that enables you to create applications with native support for spreadsheet documents. With RadSpreadProcessing, you can create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. You can save the generated workbook to a local file, stream, or stream it to the client browser.|
35-
|[RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%})|Spread streaming is a document processing paradigm that allows you to create or read big spreadsheet documents with great performance and minimal memory footprint. The key for the memory efficiency is that the spread streaming library writes the spreadsheet content directly to a stream without creating and preserving the spreadsheet document model in memory.|
36-
|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|A processing library that allows you to create, modify and export documents to a variety of formats. Through the API, you can access each element in the document and modify, remove it or add a new one. The generated content you can save as a stream, as a file, or sent it to the client browser.|
37-
|[RadZipLibrary]({%slug radziplibrary-overview%})| It allows you to compress and combine files in ZIP archives, browse and extract files from existing ZIP archives and compress streams for easy file shipping and reduced storage space.|
41+
|![Pdf](images/dpl-pdf.png) [RadPdfProcessing]({%slug radpdfprocessing-overview%})|A processing library that allows you to create, import, and export PDF documents from your code. You can use it in any web or desktop .NET application without relying on third-party software like Adobe Acrobat.|
42+
|![Spread](images/dpl-spread.png) [RadSpreadProcessing]({%slug radspreadprocessing-overview%})|A powerful library that enables you to create applications with native support for spreadsheet documents. With RadSpreadProcessing, you can create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. You can save the generated workbook to a local file, stream, or stream it to the client browser.|
43+
|![SpreadStream](images/dpl-spread.png) [RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%})|Spread streaming is a document processing paradigm that allows you to create or read big spreadsheet documents with great performance and minimal memory footprint. The key for the memory efficiency is that the spread streaming library writes the spreadsheet content directly to a stream without creating and preserving the spreadsheet document model in memory.|
44+
|![Words](images/dpl-words.png) [RadWordsProcessing]({%slug radwordsprocessing-overview%})|A processing library that allows you to create, modify and export documents to a variety of formats. Through the API, you can access each element in the document and modify, remove it or add a new one. The generated content you can save as a stream, as a file, or sent it to the client browser.|
45+
|![Zip](images/dpl-zip.png) [RadZipLibrary]({%slug radziplibrary-overview%})| It allows you to compress and combine files in ZIP archives, browse and extract files from existing ZIP archives and compress streams for easy file shipping and reduced storage space.|
3846

3947
## Key Features
4048

@@ -52,21 +60,26 @@ For more details about the benefits of using Telerik Document Processing, see th
5260

5361
## Supported Formats
5462

55-
5663
The Telerik Document Processing libraries support the following file formats:
5764

58-
* DOCX (Word Document)
59-
* DOC (Word 97-2003 Document)
60-
* DOT (Word 97-2003 Template)
61-
* HTML
62-
* PDF
63-
* RTF
64-
* TXT
65-
* XLSX (Excel Workbook)
66-
* XLS (Excel 97-2003 Workbook)
67-
* XLSM (macro-enabled spreadsheet created by Microsoft Excel) *Macros are only preserved during import and export. They cannot be executed or changed in the code.
68-
* CSV
69-
* ZIP
65+
![Ninja Looking ><](images/ninja_looking.png)
66+
67+
|Format|Library|Provider|
68+
|----|----|----|
69+
|**DOCX (Word Document)**|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|[DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%})|
70+
|**DOC (Word 97-2003 Document)**|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|[DocFormatProvider]({%slug radwordsprocessing-formats-and-conversion-doc-docformatprovider%}) <sup>Import only</sup>|[DocFormatProvider]({%slug radwordsprocessing-formats-and-conversion-doc-docformatprovider%})|
71+
|**DOT (Word 97-2003 Template)**|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|[DocFormatProvider]({%slug radwordsprocessing-formats-and-conversion-doc-docformatprovider%}) <sup>Import only</sup>|
72+
|**HTML**|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|[HtmlFormatProvider]({%slug radwordsprocessing-formats-and-conversion-html-htmlformatprovider%})|
73+
|**PDF**|[RadWordsProcessing]({%slug radwordsprocessing-overview%}) <br> [RadPdfProcessing]({%slug radpdfprocessing-overview%}) <br> [RadSpreadProcessing]({%slug radspreadprocessing-overview%})|[PdfFormatProvider in RadWordsProcessing]({%slug radwordsprocessing-formats-and-conversion-pdf-pdfformatprovider%}) <sup>Export only</sup> <br> [PdfFormatProvider in RadPdfProcessing]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%}) <br> [PdfFormatProvider in RadSpreadProcessing]({%slug radspreadprocessing-formats-and-conversion-pdf-pdfformatprovider%}) <sup>Export only</sup>|
74+
|**RTF**|[RadWordsProcessing]({%slug radwordsprocessing-overview%})|[RtfFormatProvider]({%slug radwordsprocessing-formats-and-conversion-rtf-rtfformatprovider%})|
75+
|**TXT**|[RadWordsProcessing]({%slug radwordsprocessing-overview%}) <br> [RadPdfProcessing]({%slug radpdfprocessing-overview%}) <br> [RadSpreadProcessing]({%slug radspreadprocessing-overview%})|[TxtFormatProvider in RadWordsProcessing]({%slug radwordsprocessing-formats-and-conversion-txt-txtformatprovider%}) <br> [TextFormatProvider in RadPdfProcessing]({%slug radpdfprocessing-formats-and-conversion-plain-text-textformatprovider%}) <sup>Export only</sup> <br> [TxtFormatProvider in RadSpreadProcessing]({%slug radspreadprocessing-formats-and-conversion-txt-txtformatprovider%})|
76+
|**XLSX (Excel Workbook)**|[RadSpreadProcessing]({%slug radspreadprocessing-overview%}) <br> [RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%})|[XlsxFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xlsx-xlsxformatprovider%})|
77+
|**XLS (Excel 97-2003 Workbook)**|[RadSpreadProcessing]({%slug radspreadprocessing-overview%})|[XlsFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xls-xlsformatprovider%})|
78+
|**XLSM (macro-enabled spreadsheet created by Microsoft Excel)** <sup>Macros are only preserved during import and export. They cannot be executed or changed in the code.</sup>|[RadSpreadProcessing]({%slug radspreadprocessing-overview%})|[XlsmFormatProvider]({%slug radspreadprocessing-formats-and-conversion-xlsm-xlsmformatprovider%})|
79+
|**CSV**|[RadSpreadProcessing]({%slug radspreadprocessing-overview%}) <br> [RadSpreadStreamProcessing]({%slug radspreadstreamprocessing-overview%})|[CsvFormatProvider]({%slug radspreadprocessing-formats-and-conversion-csv-csvformatprovider%})|
80+
|**DataTable**|[RadSpreadProcessing]({%slug radspreadprocessing-overview%})|[DataTableFormatProvider]({%slug radspreadprocessing-formats-and-conversion-using-data-table-format-provider%})|
81+
|**ZIP**|[RadZipLibrary]({%slug radziplibrary-overview%})|[ZipArchive]({%slug radziplibrary-gettingstarted%})|
82+
|**Image**|[RadPdfProcessing]({%slug radpdfprocessing-overview%})|[SkiaImageFormatProvider]({%slug radpdfprocessing-formats-and-conversion-image-using-skiaimageformatprovider%}) <sup>Export only</sup> <br> [OcrFormatProvider]({%slug radpdfprocessing-formats-and-conversion-ocr-ocrformatprovider%}) <sup>Import only</sup> |
7083

7184
![DPL Ninja](images/dpl-formats.png)
7285

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Extracting Text from PDF Documents
3+
description: Learn how to extract the text from a PDF document using RadPdfProcessing from the Telerik Document Processing libraries.
4+
type: how-to
5+
page_title: How to Extract the Text from PDF documents
6+
slug: extract-text-from-pdf
7+
tags: pdf, document, processing, text, extract, content
8+
res_type: kb
9+
ticketid: 1657503
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| ---- | ---- | ---- |
16+
| 2025.1.128| RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
17+
18+
## Description
19+
20+
Learn how to extract the text content in a PDF document.
21+
22+
## Solution
23+
24+
Follow the steps:
25+
26+
1\. Import the PDF document using the [PdfFormatProvider]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%}).
27+
28+
2\. Export the RadFixedDocument's content to text using the [TextFormatProvider]({%slug radpdfprocessing-formats-and-conversion-plain-text-textformatprovider%}). Thus, if the PDF document contains text fragments, it will be exported to the plain text result.
29+
30+
```csharp
31+
string filePath = "input.pdf";
32+
PdfFormatProvider pdf_provider = new PdfFormatProvider();
33+
RadFixedDocument fixed_document;
34+
using (Stream stream = File.OpenRead(filePath))
35+
{
36+
fixed_document = pdf_provider.Import(stream);
37+
}
38+
Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider provider = new Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider();
39+
40+
string documentContent = provider.Export(fixed_document);
41+
Debug.WriteLine(documentContent);
42+
```
43+
>important However, depending on the internal document's content, the **TextFormatProvider** may not be applicable for covering all the cases. A common scenario is a document with scanned images which contain text information. In this case, the above approach wouldn't parse the content to plain text because all the text inside is actually not text but [Path]({%slug radpdfprocessing-model-path%}) elements. Here comes the benefit of using the [OcrFormatProvider]({%slug radpdfprocessing-formats-and-conversion-ocr-ocrformatprovider%}) allowing you to convert images of typed, handwritten, or printed text into machine-encoded text from a scanned document.
44+
45+
## See Also
46+
47+
- [RadPdfProcessing]({%slug radpdfprocessing-overview%})
48+
- [OcrFormatProvider]({%slug radpdfprocessing-formats-and-conversion-ocr-ocrformatprovider%})
49+
- [TextFormatProvider]({%slug radpdfprocessing-formats-and-conversion-plain-text-textformatprovider%})
50+
- [Summarizing the Text Content of PDF Documents using Text Analytics with Azure AI services]({%slug summarize-pdf-content%})
51+
79.6 KB
Loading
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: Summarizing the Text Content of PDF Documents using Text Analytics with Azure AI services
3+
description: Learn how to summarize the text content from a PDF document using RadPdfProcessing and Text Analytics with Azure AI services.
4+
type: how-to
5+
page_title: How to Summarize the Text Content of PDF documents using Text Analytics with Azure AI services
6+
slug: summarize-pdf-content
7+
tags: pdf, document, processing, text, summarize, summary, content, azure
8+
res_type: kb
9+
ticketid: 1657503
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| ---- | ---- | ---- |
16+
| 2025.1.128| RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
17+
18+
## Description
19+
20+
Learn how to summarize the text content of a PDF document using [Text Analytics with Azure AI services](https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-text-analytics-use-mmlspark).
21+
22+
## Solution
23+
24+
Follow the steps:
25+
26+
1\. Before going further, you can find listed below the **required** assemblies/NuGet packages that should be added to your project:
27+
28+
* [Azure.AI.TextAnalytics](https://www.nuget.org/packages/Azure.AI.TextAnalytics)
29+
* Telerik.Documents.Fixed
30+
* Telerik.Documents.Core
31+
* Telerik.Zip
32+
33+
2\. It is necessary to generate your Azure AI key and endpoint: [Get your credentials from your Azure AI services resource](https://learn.microsoft.com/en-us/azure/ai-services/use-key-vault?tabs=azure-cli&pivots=programming-language-csharp)
34+
35+
![Azure AI key](images/azure-ai-key.png)
36+
37+
3\. [Extract the text content from a PDF document]({%slug extract-text-from-pdf%}).
38+
39+
4\. Use the custom implementation to summarize the text content extracted in step 3:
40+
41+
```csharp
42+
static void Main(string[] args)
43+
{
44+
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider pdf_provider = new PdfFormatProvider();
45+
Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider text_provider = new TextFormatProvider();
46+
Telerik.Windows.Documents.Fixed.Model.RadFixedDocument document = pdf_provider.Import(File.ReadAllBytes("PdfDocument.pdf"), TimeSpan.FromSeconds(10));
47+
string documentTextContent = text_provider.Export(document);
48+
49+
AzureTextSummarizationProvider summarizationProvider = new AzureTextSummarizationProvider(azure_key, azure_endpoint);
50+
string summary = summarizationProvider.SummarizeText(documentTextContent).Result;
51+
52+
Console.WriteLine(summary);
53+
}
54+
55+
public class AzureTextSummarizationProvider
56+
{
57+
private string languageKey;
58+
private string languageEndpoint;
59+
60+
public AzureTextSummarizationProvider(string azure_key, string azure_endpoint)
61+
{
62+
this.languageKey = azure_key;
63+
this.languageEndpoint = azure_endpoint;
64+
}
65+
66+
public async Task<string> SummarizeText(string text)
67+
{
68+
Azure.AzureKeyCredential credentials = new Azure.AzureKeyCredential(languageKey);
69+
Uri endpoint = new Uri(languageEndpoint);
70+
71+
Azure.AI.TextAnalytics.TextAnalyticsClient client = new Azure.AI.TextAnalytics.TextAnalyticsClient(endpoint, credentials);
72+
73+
// Prepare analyze operation input. You can add multiple documents to this list and perform the same
74+
// operation to all of them.
75+
List<string> batchInput = new List<string>
76+
{
77+
text
78+
};
79+
80+
Azure.AI.TextAnalytics.TextAnalyticsActions actions = new Azure.AI.TextAnalytics.TextAnalyticsActions()
81+
{
82+
ExtractiveSummarizeActions = [new Azure.AI.TextAnalytics.ExtractiveSummarizeAction()]
83+
};
84+
85+
// Start analysis process.
86+
Azure.AI.TextAnalytics.AnalyzeActionsOperation operation = await client.StartAnalyzeActionsAsync(batchInput, actions);
87+
await operation.WaitForCompletionAsync();
88+
89+
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
90+
// View operation status.
91+
stringBuilder.AppendLine($"AnalyzeActions operation has completed");
92+
stringBuilder.AppendLine();
93+
94+
stringBuilder.AppendLine($"Created On : {operation.CreatedOn}");
95+
stringBuilder.AppendLine($"Expires On : {operation.ExpiresOn}");
96+
stringBuilder.AppendLine($"Id : {operation.Id}");
97+
stringBuilder.AppendLine($"Status : {operation.Status}");
98+
99+
stringBuilder.AppendLine();
100+
// View operation results.
101+
await foreach (Azure.AI.TextAnalytics.AnalyzeActionsResult documentsInPage in operation.Value)
102+
{
103+
IReadOnlyCollection<Azure.AI.TextAnalytics.ExtractiveSummarizeActionResult> summaryResults = documentsInPage.ExtractiveSummarizeResults;
104+
105+
foreach (Azure.AI.TextAnalytics.ExtractiveSummarizeActionResult summaryActionResults in summaryResults)
106+
{
107+
if (summaryActionResults.HasError)
108+
{
109+
stringBuilder.AppendLine($" Error!");
110+
stringBuilder.AppendLine($" Action error code: {summaryActionResults.Error.ErrorCode}.");
111+
stringBuilder.AppendLine($" Message: {summaryActionResults.Error.Message}");
112+
continue;
113+
}
114+
115+
foreach (Azure.AI.TextAnalytics.ExtractiveSummarizeResult documentResults in summaryActionResults.DocumentsResults)
116+
{
117+
if (documentResults.HasError)
118+
{
119+
stringBuilder.AppendLine($" Error!");
120+
stringBuilder.AppendLine($" Document error code: {documentResults.Error.ErrorCode}.");
121+
stringBuilder.AppendLine($" Message: {documentResults.Error.Message}");
122+
continue;
123+
}
124+
125+
stringBuilder.AppendLine($" Extracted the following {documentResults.Sentences.Count} sentence(s):");
126+
stringBuilder.AppendLine();
127+
128+
foreach (Azure.AI.TextAnalytics.ExtractiveSummarySentence sentence in documentResults.Sentences)
129+
{
130+
stringBuilder.Append($"{sentence.Text} ");
131+
}
132+
}
133+
}
134+
}
135+
136+
string result = stringBuilder.ToString();
137+
138+
return result;
139+
}
140+
}
141+
```
142+
143+
## See Also
144+
145+
- [Extracting Text from PDF Documents]({%slug extract-text-from-pdf%})
146+
- [OcrFormatProvider]({%slug radpdfprocessing-formats-and-conversion-ocr-ocrformatprovider%})
147+
- [TextFormatProvider]({%slug radpdfprocessing-formats-and-conversion-plain-text-textformatprovider%})
148+

libraries/radpdfprocessing/formats-and-conversion/ocr/ocrformatprovider.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ position: 1
1212

1313
Since _Q1 2025_ the __RadPdfProcessing__ library supports Optical Character Recognition (OCR). OCR is the electronic or mechanical conversion of images of typed, handwritten, or printed text into machine-encoded text from a scanned document. The library uses the **OcrFormatProvider** class that allows you to import an image which is returned as a [RadFixedPage]({%slug radpdfprocessing-model-radfixedpage%}). By default, the **OcrFormatProvider** takes as a parameter a **TesseractOcrProvider** implementation which is achieved by using the third-party library [Tesseract](https://github.com/tesseract-ocr/tesseract), however you can provide any [custom implementation]({%slug radpdfprocessing-formats-and-conversion-ocr-custom-ocrprovider%}) instead.
1414

15-
You can find all the dependencies and required steps for the implementation in the [Prerequisites]({%slug radpdfprocessing-formats-and-conversion-ocr-prerequisites%}) artilce.
15+
You can find all the dependencies and required steps for the implementation in the [Prerequisites]({%slug radpdfprocessing-formats-and-conversion-ocr-prerequisites%}) article.
1616

1717
## TesseractOcrProvider Public API
1818

@@ -35,3 +35,4 @@ You can find all the dependencies and required steps for the implementation in t
3535
* [Prerequisites]({%slug radpdfprocessing-formats-and-conversion-ocr-prerequisites%})
3636
* [Timeout Mechanism]({%slug timeout-mechanism-in-dpl%})
3737
* [Implementing a Custom OCR Provider]({%slug radpdfprocessing-formats-and-conversion-ocr-custom-ocrprovider%})
38+
* [Extracting Text from PDF Documents]({%slug extract-text-from-pdf%})

0 commit comments

Comments
 (0)