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
89 changes: 89 additions & 0 deletions knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Resolving Double-Bold Text Appearance in PDF Export Using Telerik Document Processing
description: Learn how to resolve the double-bold text appearance issue in PDFs generated by Telerik WordsProcessing using font registration and style configuration.
type: how-to
page_title: Fixing Double-Bold Text Issue in PDFs Exported from Telerik WordsProcessing
meta_title: Fixing Double-Bold Text Issue in PDFs Exported from Telerik WordsProcessing
slug: fixing-double-bold-text-issue-in-pdf-document
tags: word,processing, pdf, provider, font,embed, arial, narrow, register, bold
res_type: kb
ticketid: 1698628
---

## Environment

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

## Description

When exporting documents to PDF using Telerik WordsProcessing, the bold text may appear "double-bold" in browsers like Edge or Chrome. This issue arises due to font embedding settings or inaccuracies in font file access, specifically with condensed fonts like Arial Narrow Bold.
This knowledge base article gives some tips how to fix double-bold text rendering issues in PDFs generated by Telerik WordsProcessing.

## Solution

The "double bold" text appearance in PDF viewers like Edge or Chrome is typically caused by font embedding. Using [FontEmbeddingType.Full]({%slug radpdfprocessing-formats-and-conversion-pdf-settings%}) can sometimes cause duplication if both, regular and bold, font variants are embedded and the viewer applies bold rendering on top. If your style already sets bold, avoid setting the Run.FontWeight property to FontWeights.Bold again. Double-assigning bold can lead to rendering issues.

To resolve the double-bold appearance issue, manually register the correct font files for Arial Narrow Bold and configure the style settings properly. Follow these steps:

1. Register the correct font files at the start of your application using FontsRepository.[RegisterFont]({%slug radpdfprocessing-concepts-fonts%}#registering-a-font). This ensures that the library uses the appropriate font variations for bold and italic.

```csharp
FontsRepository.RegisterFont(new System.Windows.Media.FontFamily("Arial Narrow"), FontStyles.Normal, FontWeights.Bold,
File.ReadAllBytes(@"C:\WINDOWS\FONTS\ARIALNB.TTF"));
FontsRepository.RegisterFont(new System.Windows.Media.FontFamily("Arial Narrow"), FontStyles.Italic, FontWeights.Normal,
File.ReadAllBytes(@"C:\WINDOWS\FONTS\ARIALNI.TTF"));
FontsRepository.RegisterFont(new System.Windows.Media.FontFamily("Arial Narrow"), FontStyles.Italic, FontWeights.Bold,
File.ReadAllBytes(@"C:\WINDOWS\FONTS\ARIALNBI.TTF"));
```

2. Define a [style]({%slug radwordsprocessing-concepts-styles%}) for the desired section to apply the correct font family and weight settings.

```csharp
Telerik.Windows.Documents.Flow.Model.Styles.Style referenceStyleChar = new Telerik.Windows.Documents.Flow.Model.Styles.Style("ReferenceStyleChar", StyleType.Character);
referenceStyleChar.Name = "Reference Style Char";
referenceStyleChar.CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Arial Narrow");
referenceStyleChar.CharacterProperties.FontStyle.LocalValue = FontStyles.Normal;
referenceStyleChar.CharacterProperties.FontWeight.LocalValue = FontWeights.Bold;
document.StyleRepository.Add(referenceStyleChar);
```

3. Apply the style to the desired text or [Runs]({%slug radwordsprocessing-model-run%}) in your document.

```csharp
foreach (var referenceParagraph in referenceParagraphs)
{
foreach (var inline in referenceParagraph.Inlines)
{
Run run = inline as Run;
if (run != null)
{
run.StyleId = "ReferenceStyleChar";
}
}
}
```

4. Use the `FontEmbeddingType.Subset` setting when [exporting to PDF]({%slug radwordsprocessing-formats-and-conversion-pdf-settings%}) to avoid redundant font embedding.

```csharp
PdfFormatProvider PDFprovider = new PdfFormatProvider();
PDFprovider.ExportSettings = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExportSettings
{
FontEmbeddingType = FontEmbeddingType.Subset
};

using (Stream output = File.OpenWrite(Server.MapPath("~/App_Data/Output.pdf")))
{
PDFprovider.Export(document, output, TimeSpan.FromSeconds(10));
}
```

5. Test the exported PDF in different viewers to confirm that the bold text appears correctly without the "double-bold" effect.

## See Also

- [Fonts in PdfProcessing]({%slug radpdfprocessing-concepts-fonts%})


1 change: 1 addition & 0 deletions libraries/radpdfprocessing/concepts/fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,4 @@ You can create fonts that are not explicitly registered. Creating a font that is
* [How to Prevent Text with Special Characters from Being Cut Off when converting HTML to PDF using RadWordsProcessing]({%slug prevent-text-cut-off-pdf-conversion-radwordsprocessing%})
* [Validating Fonts when Using Telerik Document Processing]({%slug validating-fonts-pdf-document-processing%})
* [Resolving Apostrophe Character Being Replaced with Copyright Symbol in Filled PDF AcroForm]({%slug apostrophe-character-replaced-copyright-symbol-acroform%})
* [Resolving Double-Bold Text Appearance in PDF Export Using Telerik Document Processing]({%slug fixing-double-bold-text-issue-in-pdf-document%})