Skip to content

Commit 1623e3a

Browse files
committed
new kb
1 parent 392b4f9 commit 1623e3a

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed
5.46 KB
Loading

knowledge-base/pdfprocessing-text-color.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type: how-to
55
page_title: How to Change Text Color Using PdfProcessing
66
meta_title: How to Change Text Color Using PdfProcessing
77
slug: pdfprocessing-text-color
8-
tags: pdf, processing, text color, cell, fill, color, graphic, properties
8+
tags: pdf, processing, text, color, block, color, graphic
99
res_type: kb
1010
ticketid: 1695311
1111
---
@@ -18,27 +18,13 @@ ticketid: 1695311
1818

1919
## Description
2020

21-
I want to set the text color in a cell but cannot find an option for this in `TextProperties`. The only visible option is `HighlightColor`.
21+
Learn how to change the forecolor (e.g. red color) for a text block.
2222

23-
This knowledge base article also answers the following questions:
24-
- How to change the text color in PdfProcessing cells?
25-
- How to use FillColor to set cell text color in Telerik Document Processing?
26-
- What is the method to apply custom text color in RadPdfProcessing blocks?
23+
![Change Text Block's ForeColor ><](images/pdfprocessing-text-color.png)
2724

2825
## Solution
2926

30-
To set the text color in a cell, use the `FillColor` property of `GraphicProperties`. This property determines the color used for rendering content elements of a block. To apply the change only to specific text, use the `SaveGraphicProperties()` and `RestoreGraphicProperties()` methods. These methods allow you to apply a temporary change and revert to the previous settings.
31-
32-
Follow the steps below:
33-
34-
1. Create a new `RadFixedDocument` and add a page.
35-
2. Initialize a `FixedContentEditor` for the page.
36-
3. Create a `Block` and call `SaveGraphicProperties()` to save the current settings.
37-
4. Assign a color to `GraphicProperties.FillColor`.
38-
5. Insert the text that needs the custom color.
39-
6. Call `RestoreGraphicProperties()` to revert to the previous settings.
40-
7. Continue adding text or elements to the block.
41-
8. Export the document using `PdfFormatProvider`.
27+
To set the fore color in a text block, use the `FillColor` property of `GraphicProperties`. This property determines the color used for rendering content elements of a block. To apply the change only to specific text, use the `SaveGraphicProperties()` and `RestoreGraphicProperties()` methods. These methods allow you to apply a temporary change and revert to the previous settings.
4228

4329
### Example Code
4430

@@ -79,6 +65,4 @@ Process.Start(new ProcessStartInfo() { UseShellExecute = true, FileName = fileNa
7965

8066
## See Also
8167

82-
- [Text and Graphic Properties in PdfProcessing](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/editing/text-and-graphic-properties)
83-
- [Block Class Documentation](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/editing/block)
84-
- [RadPdfProcessing Overview](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/overview)
68+
- [Text and Graphic Properties in PdfProcessing]({%slug radpdfprocessing-editing-text-and-graphic-properties%})

libraries/radpdfprocessing/editing/block.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,4 @@ The code in __Example 9__ splits a block in two. The first will contains text "H
298298
* [How to Measure Text in WordsProcessing .NET Framework]({%slug wordsprocessing-measure-text-netframework%})
299299
* [How to Measure Text in WordsProcessing .NET Standard]({%slug wordsprocessing-measure-text-netstandard%})
300300
* [How to Generate a PDF Document from Images with FixedContentEditor]({%slug pdf-from-images-with-fixedcontenteditor%})
301+
* [How to Change Text Color Using PdfProcessing]({%slug pdfprocessing-text-color%})

libraries/radpdfprocessing/editing/text-and-graphic-properties.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,4 @@ Both Text and Graphic properties contain methods that can preserve and restore t
127127
* [FixedContentEditor]({%slug radpdfprocessing-editing-fixedcontenteditor%})
128128
* [Block]({%slug radpdfprocessing-editing-block%})
129129
* [Changing Block's Text Color in PDF Documents Using RadPdfProcessing]({%slug change-text-color-pdf-radpdfprocessing%})
130+
* [How to Change Text Color Using PdfProcessing]({%slug pdfprocessing-text-color%})

0 commit comments

Comments
 (0)