# Setting Text Color Using PdfProcessing

## Environment

| Version    | Product          | Author                                                                          |
| ---------- | ---------------- | ------------------------------------------------------------------------------- |
| 2025.2.520 | RadPdfProcessing | [Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova) |

## Description

Learn how to change the text color of a [Block](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/block).

![Change Text Block's ForeColor ><](https://www.telerik.com/document-processing-libraries/documentation/assets/fcaaf541b864e7efa68657a88addd774/pdfprocessing-text-color.png)

## Solution

To set the text color of a block, use the `FillColor` property of the [Block](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/block)'s `GraphicProperties`. This property determines the color used for rendering the content elements of a block. To apply the change only to specific text, use the `SaveGraphicProperties()` and `RestoreGraphicProperties()` methods. These methods let you apply a temporary change and revert to the previous settings.

**Example 1: Set Text Color with FillColor**

```csharp
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);

// Create a block to add styled content
Block infoBlock = new Block();

// Save current graphic properties
infoBlock.SaveGraphicProperties();

// Set the FillColor for the text
infoBlock.GraphicProperties.FillColor = new RgbColor(255, 10, 10);
infoBlock.InsertText("Telerik Document Processing: ");

// Restore previous graphic properties
infoBlock.RestoreGraphicProperties();
infoBlock.InsertLineBreak();
infoBlock.InsertText("RadPdfProcessing");
infoBlock.InsertLineBreak();

// Position and draw the block
editor.Position.Translate(100, 100);
editor.DrawBlock(infoBlock);

// Export the document
string fileName = $"{Guid.NewGuid()}.pdf";
File.Delete(fileName);
PdfFormatProvider provider = new PdfFormatProvider();
using Stream stream = File.OpenWrite(fileName);
provider.Export(document, stream, TimeSpan.FromSeconds(10));

Process.Start(new ProcessStartInfo() { UseShellExecute = true, FileName = fileName });
```

## See Also

* [Text and Graphic Properties in PdfProcessing](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/text-and-graphic-properties)
