Skip to content

Commit c30cbfc

Browse files
authored
Merge branch 'master' into new-kb-radwordsprocessing-find-table-by-bookmark-faa605e770b34efbb917964e9b91d58b
2 parents ad841b1 + 6dd23ff commit c30cbfc

File tree

66 files changed

+1110
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1110
-83
lines changed

introduction.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ The Telerik Document Processing libraries support the following file formats:
5555

5656
## Available Assemblies
5757

58-
>The Telerik Document Processing libraries are available in **.NET Framework** and **.NET Standard** (**.NET Core**) compatible versions. You can download the assemblies of these libraries from the following products:
58+
>The Telerik Document Processing libraries are available in **.NET Framework**, **.NET Core/.NET 6/.NET 8** (or newer) for Windows and **.NET Standard** compatible versions. You can download the assemblies of these libraries from the following products:
5959
>
6060
61-
|.NET Framework Products|.NET Standard/Core/5+ Products|
62-
|----|----|
63-
|[UI for ASP.NET MVC](https://www.telerik.com/aspnet-mvc)|[UI for Xamarin](https://www.telerik.com/xamarin-ui)|
64-
|[UI for ASP.NET AJAX](https://www.telerik.com/products/aspnet-ajax.aspx)|[UI for ASP.NET Core](https://www.telerik.com/aspnet-core-ui)|
65-
|[UI for WPF](https://www.telerik.com/products/wpf/overview.aspx)|[UI for Blazor](https://www.telerik.com/blazor-ui)|
66-
|[UI for WinForms](https://www.telerik.com/products/winforms.aspx)|[UI for WinUI](https://www.telerik.com/winui)|
67-
|[UI for Silverlight (discontinued)](https://www.telerik.com/products/silverlight/overview.aspx)|[UI for .NET MAUI](https://www.telerik.com/maui-ui)|
61+
|.NET Framework Products|.NET Core/.NET 6/ .NET 8 (or newer) *for Windows*|.NET Standard|
62+
|----|----|----|
63+
|[UI for ASP.NET MVC](https://www.telerik.com/aspnet-mvc)||[UI for Xamarin](https://www.telerik.com/xamarin-ui)|
64+
|[UI for ASP.NET AJAX](https://www.telerik.com/products/aspnet-ajax.aspx)||[UI for ASP.NET Core](https://www.telerik.com/aspnet-core-ui)|
65+
|[UI for WPF](https://www.telerik.com/products/wpf/overview.aspx)|[UI for WPF](https://www.telerik.com/products/wpf/overview.aspx)|[UI for Blazor](https://www.telerik.com/blazor-ui)|
66+
|[UI for WinForms](https://www.telerik.com/products/winforms.aspx)|[UI for WinForms](https://www.telerik.com/products/winforms.aspx)|[UI for WinUI](https://www.telerik.com/winui)|
67+
|[UI for Silverlight (discontinued)](https://www.telerik.com/products/silverlight/overview.aspx)||[UI for .NET MAUI](https://www.telerik.com/maui-ui)|
6868

69-
Both versions are available as [NuGet packages]({%slug installation-nuget-packages%}) but with different names. The assemblies for .NET Standard do not contain the word Windows in their name.
69+
All versions are available as [NuGet packages]({%slug installation-nuget-packages%}). The assemblies/packages for .NET Standard do not contain the word *Windows* in their name.
7070

7171
## Getting Started
7272

@@ -129,3 +129,4 @@ Thank you for your contribution to the Telerik Document Processing Libraries' Do
129129

130130
- [Document Processing Libraries Overview]({%slug getting-started%})
131131
- [First Steps in using Telerik Document Processing]({%slug getting-started-first-steps%})
132+
- [What Versions of Document Processing Libraries are Distributed with the Telerik Products]({%slug distribute-telerik-document-processing-libraries-net-versions%})
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Adding a Watermark to PDF Files Using RadPdfProcessing
3+
description: Learn how to add custom watermarks to PDF documents using the RadPdfProcessing library.
4+
type: how-to
5+
page_title: How to Add Watermarks to PDF Documents with RadPdfProcessing
6+
slug: add-watermark-pdf-radpdfprocessing
7+
tags: radpdfprocessing, document processing, watermark, pdf, text watermark
8+
res_type: kb
9+
ticketid: 1653970
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| --- | --- | ---- |
16+
| 2024.2.426| RadPdfProcessing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
17+
18+
## Description
19+
20+
This KB article demonstrates how to add a text watermark across all pages of a PDF document using RadPdfProcessing.
21+
22+
## Solution
23+
24+
To add a watermark to PDF pages using RadPdfProcessing, follow these steps:
25+
26+
1. Import the PDF document using [PdfFormatProvider]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%}).
27+
2. Iterate through each page of the document.
28+
3. Use [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}) to add a watermark text block to each page.
29+
4. Customize the watermark's text properties, color, and position.
30+
5. [Export](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider#export) the document with watermarks back to a PDF file.
31+
32+
Here is a complete code snippet demonstrating these steps:
33+
34+
```csharp
35+
static void Main(string[] args)
36+
{
37+
string fileName = "sample.pdf";
38+
PdfFormatProvider provider = new PdfFormatProvider();
39+
RadFixedDocument document = provider.Import(File.ReadAllBytes(fileName));
40+
41+
foreach (RadFixedPage page in document.Pages)
42+
{
43+
AddWatermarkText(page, "Watermark text!", 100);
44+
}
45+
46+
string exportFileName = "testWatermarks.pdf";
47+
File.Delete(exportFileName);
48+
49+
File.WriteAllBytes(exportFileName, new PdfFormatProvider().Export(document));
50+
ProcessStartInfo psi = new ProcessStartInfo()
51+
{
52+
FileName = exportFileName,
53+
UseShellExecute = true
54+
};
55+
Process.Start(psi);
56+
}
57+
58+
private static void AddWatermarkText(RadFixedPage page, string text, byte transparency)
59+
{
60+
FixedContentEditor editor = new FixedContentEditor(page);
61+
62+
Block block = new Block();
63+
block.TextProperties.FontSize = 80;
64+
block.TextProperties.TrySetFont(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Bold);
65+
block.HorizontalAlignment = Telerik.Windows.Documents.Fixed.Model.Editing.Flow.HorizontalAlignment.Center;
66+
block.GraphicProperties.FillColor = new RgbColor(transparency, 255, 0, 0);
67+
block.InsertText(text);
68+
69+
double angle = -45;
70+
editor.Position.Rotate(angle);
71+
editor.Position.Translate(0, page.Size.Width);
72+
editor.DrawBlock(block, new Size(page.Size.Width / Math.Abs(Math.Sin(angle)), double.MaxValue));
73+
}
74+
```
75+
76+
![Pdf Watermark](images/pdf-watermark.png)
77+
78+
## See Also
79+
80+
- [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
81+
- [SDK Example: Add Watermark](https://github.com/telerik/document-processing-sdk/blob/master/PdfProcessing/AddWatermark/Program.cs)
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: Changing Checkbox State in Word Templates with RadWordsProcessing
3+
description: Learn how to programmatically change the state of a checkbox in a Word document template using RadWordsProcessing.
4+
type: how-to
5+
page_title: How to Programmatically Modify Checkbox States in Word Document Templates Using RadWordsProcessing
6+
slug: change-checkbox-state-radwordsprocessing
7+
tags: radwordsprocessing, document processing, checkbox, word, template
8+
res_type: kb
9+
ticketid: 1656247
10+
---
11+
12+
## Environment
13+
14+
|Product Version|Product|Author|
15+
|----|----|----|
16+
|2024.2.426|RadWordsProcessing|[Yoan Karamanov](https://www.telerik.com/blogs/author/yoan-karamanov)|
17+
18+
## Description
19+
20+
When working with Word templates that include checkboxes as content controls, you may need to change the state of a checkbox based on certain conditions. This KB article provides a method to programmatically check or uncheck a checkbox using the RadWordsProcessing library.
21+
22+
This KB article also answers the following questions:
23+
- How can I programmatically check a checkbox in a Word document?
24+
- How do I modify the state of a checkbox in a Word template?
25+
- What is the method to change checkbox states in Word documents using C#?
26+
27+
## Solution
28+
29+
To change the state of a checkbox in a Word document, follow these steps:
30+
31+
1. Identify the content control that represents the checkbox.
32+
2. Change the checkbox's state to either checked or unchecked.
33+
3. Update the visual representation of the checkbox accordingly.
34+
35+
Below is a method that demonstrates how to achieve this:
36+
37+
```csharp
38+
private static void ChangeCheckboxState(SdtRangeStart sdt)
39+
{
40+
if (sdt == null || sdt.SdtProperties.Type != SdtType.CheckBox)
41+
{
42+
return;
43+
}
44+
45+
// Get the paragraph that is parent of the checkbox
46+
Paragraph paragraph = sdt.Paragraph;
47+
48+
// Get the index of the SDT start in the paragraph's child collection
49+
int index = paragraph.Inlines.IndexOf(sdt);
50+
51+
// Get the Run that represents the checkbox' value
52+
Run checkBoxValue = paragraph.Inlines[index + 1] as Run;
53+
CheckBoxProperties properties = (CheckBoxProperties)sdt.SdtProperties;
54+
if (!properties.Checked.HasValue || !properties.Checked.Value)
55+
{
56+
properties.Checked = true;
57+
58+
if (checkBoxValue != null)
59+
{
60+
checkBoxValue.Properties.FontFamily.LocalValue = new ThemableFontFamily(properties.CheckedState.Font);
61+
checkBoxValue.Text = ((char)properties.CheckedState.CharacterCode).ToString();
62+
}
63+
}
64+
else
65+
{
66+
properties.Checked = false;
67+
68+
if (checkBoxValue != null)
69+
{
70+
checkBoxValue.Properties.FontFamily.LocalValue = new ThemableFontFamily(properties.UncheckedState.Font);
71+
checkBoxValue.Text = ((char)properties.UncheckedState.CharacterCode).ToString();
72+
}
73+
}
74+
}
75+
```
76+
77+
To apply this method, iterate through the content controls in your document, and call `ChangeCheckboxState` for each checkbox you wish to modify. Alternatively, get the first SdtRangeStart and update its state:
78+
79+
```csharp
80+
SdtRangeStart stdStart = document.EnumerateChildrenOfType<SdtRangeStart>().First();
81+
ChangeCheckboxState(stdStart);
82+
```
83+
84+
85+
## Notes
86+
87+
- Ensure that you have identified the correct content control by checking its tag or other properties.
88+
- The visual representation of the checkbox is determined by the font family and character code specified in the `CheckedState` and `UncheckedState` of the `CheckBoxProperties`.
89+
90+
## See Also
91+
92+
- [Working with Content Controls]({%slug wordsprocessing-model-working-with-content-controls%})
93+
- [Content Controls (Structured Document Tags)]({%slug wordsprocessing-model-content-controls%})

knowledge-base/create-dashed-line-border-table-radpdfprocessing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ Please note that you can modify the `Borders` property of the `DefaultCellProper
7676
table.DefaultCellProperties.Borders = new TableCellBorders(null, null, null,b);
7777
```
7878

79+
>note As of **Q3 2024** RadPdfProcessing offers *Dotted*, *Dashed*, and *DashSmallGap* [border styles]({%slug radpdfprocessing-editing-table%}) out-of-the-box without the necessity to play with the **StrokeDashArray** of the **FixedContentEditor**. With this update, the Dotted, Dashed, DashSmallGap, and Thick border lines are now exported from [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%}) to [RadFixedDocument]({%slug radpdfprocessing-model-radfixeddocument%}) as well.
80+
7981
## See Also
8082

8183
* [TableCell]({%slug radpdfprocessing-editing-tablecell%})
8284
* [Table]({%slug radpdfprocessing-editing-table%})
83-
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%}})
84-
* [Create Repeating Table Header Row in PdfProcessing]({%slug pdfprocessing-create-repeat-header-row%})
85+
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
86+
* [Supported Border Styles]({%slug radpdfprocessing-editing-table%})
8587

8688

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: What Versions of Document Processing Libraries are Distributed with the Telerik Products
3+
description: Learn how to obtain Telerik Document Processing libraries suitable for .NET Framework, .NET Standard, .NET Core, .NET 6, and newer versions.
4+
type: how-to
5+
page_title: How to Obtain Telerik Document Processing Libraries for .NET Framework, .NET Standard, .NET Core, .NET 6, and newer versions
6+
slug: distribute-telerik-document-processing-libraries-net-versions
7+
tags: telerik, document, processing, net, core, nuget, packages, framework, windows, distribute, libraries, standard
8+
res_type: kb
9+
ticketid: 1658084
10+
---
11+
12+
## Environment
13+
14+
| Version | Product | Author |
15+
| --- | --- | ---- |
16+
| 2024.2.426| Telerik Document Processing|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
17+
18+
## Description
19+
Learn how to find and download the Telerik Document Processing libraries for the appropriate .NET version and ensure compatibility of Telerik Document Processing libraries with the used target framework in the project.
20+
21+
## Solution
22+
23+
The [Telerik Document Processing]({%slug introduction%}) libraries are compatible across different .NET implementations, including .NET Framework, .NET Standard .NET Core, .NET 6, .NET 8, and newer versions. However, the libraries are [distributed with different Telerik UI products]({%slug installation-deploying-telerik-document-processing%}). Depending on the target framework of your project (NET Framework, .NET Standard .NET Core, .NET 6, etc.), you should pick the library version accordingly.
24+
25+
Depending on the product suite you are using (Telerik UI for WinForms, WPF, ASP.NET AJAX, Blazor, ASP.NET Core, etc.), the [libraries are included](https://docs.telerik.com/devtools/document-processing/introduction#available-assemblies) in the respective NuGet packages:
26+
27+
- For **.NET Framework** projects, libraries are distributed with Telerik UI for WinForms, WPF, ASP.NET AJAX, ASP.NET MVC.
28+
29+
![DPL NET Framework](images/dpl-net-framework.png)
30+
31+
- For **.NET Core / .NET 6 / .NET 8** (or newer) projects, libraries are included with Telerik UI for WinForms and WPF.
32+
33+
![DPL NET Core](images/dpl-net-core.png)
34+
35+
![DPL NET Core Windows](images/dpl-net-core-windows.png)
36+
37+
- For projects targeting .NET Standard, libraries are distributed with Telerik UI for Blazor, ASP.NET Core, .NET MAUI, WinUI, Xamarin.
38+
39+
![DPL NET Standard](images/dpl-net-standard.png)
40+
41+
![DPL NET Standard None OS](images/dpl-net-standard-none-os.png)
42+
43+
As the above screenshots shows, the respective NuGet package indicates the exact target frameworks version considering the application's Target framework and Target OS. All versions are available as [NuGet packages]({%slug installation-nuget-packages%}). The assemblies/packages for .NET Standard do not contain the word *Windows* in their name.
44+
45+
>note There are no implementation/functionality differences between the Document Processing versions for .NET Framework and .NET Core/.NET 6 (or newer). However, the .NET Standard version comes with some limitations. More information about the limitations can be found in the [Cross-Platform Support]({%slug radpdfprocessing-cross-platform%}) article.
46+
47+
### Download the Libraries
48+
49+
To download the libraries, visit the [Telerik Document Processing installation guide]({%slug installation-installing-on-your-computer%}). This guide provides detailed instructions on how to install the libraries on your computer, catering to the specific product suite you are using.
50+
51+
## Notes
52+
53+
- Ensure that your project's target framework is compatible with the version of the Telerik Document Processing libraries you intend to use.
54+
- The functionality and implementation of the Document Processing libraries remain consistent across different .NET versions, with some exceptions noted for .NET Standard.
55+
56+
## See Also
57+
58+
- [Cross-Platform Support for Telerik Document Processing]({%slug radpdfprocessing-cross-platform%})
59+
- [Supported Target Frameworks](https://docs.telerik.com/devtools/document-processing/introduction#available-assemblies)
60+
- [Installing Telerik Document Processing on Your Computer]({%slug installation-deploying-telerik-document-processing%})

0 commit comments

Comments
 (0)