From c91b3d4201f57e5f868c8e837c4574731d8427a8 Mon Sep 17 00:00:00 2001 From: KB Bot Date: Fri, 19 Sep 2025 08:30:39 +0000 Subject: [PATCH 1/3] Added new kb article fixing-double-bold-text-issue-in-pdf-document --- ...-double-bold-text-issue-in-pdf-document.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md diff --git a/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md new file mode 100644 index 00000000..1c27d684 --- /dev/null +++ b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md @@ -0,0 +1,95 @@ +--- +title: Resolving Double-Bold Appearance in PDF Export Using Telerik WordsProcessing +description: Learn how to resolve the double-bold 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: words,processing, pdf, pdfformatprovider, font,embed, arial-narrow, register +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 PDF viewers 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 also answers the following questions: +- How to fix bold text rendering issues in PDFs generated by Telerik WordsProcessing? +- Why does the bold text in PDFs look thicker than expected? +- How to correctly embed Arial Narrow Bold in Telerik WordsProcessing? + +## Solution + +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`. 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 for the references 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 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 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 + +- [WordsProcessing Overview](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/overview) +- [PdfFormatProvider](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/pdfformatprovider/overview) +- [FontEmbeddingType Enum](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.flow.formatproviders.pdf.export.fontembeddingtype) +- [RegisterFont Method](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.flow.model.fonts.fontrepository#registerfont) +- [System.Windows.Media.Typeface.TryGetGlyphTypeface Issue](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.typeface.trygetglyphtypeface?redirectedfrom=MSDN) + + From 605c1454c0de663a0a4d9ee11e98b928a30e3f83 Mon Sep 17 00:00:00 2001 From: Desislava Yordanova Date: Fri, 26 Sep 2025 17:18:58 +0300 Subject: [PATCH 2/3] polished KB --- ...-double-bold-text-issue-in-pdf-document.md | 30 ++++++++----------- libraries/radpdfprocessing/concepts/fonts.md | 1 + 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md index 1c27d684..5aac9d68 100644 --- a/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md +++ b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md @@ -1,11 +1,11 @@ --- -title: Resolving Double-Bold Appearance in PDF Export Using Telerik WordsProcessing -description: Learn how to resolve the double-bold appearance issue in PDFs generated by Telerik WordsProcessing using font registration and style configuration. +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: words,processing, pdf, pdfformatprovider, font,embed, arial-narrow, register +tags: word,processing, pdf, provider, font,embed, arial, narrow, register, bold res_type: kb ticketid: 1698628 --- @@ -18,18 +18,16 @@ ticketid: 1698628 ## Description -When exporting documents to PDF using Telerik WordsProcessing, the bold text may appear "double-bold" in PDF viewers 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 also answers the following questions: -- How to fix bold text rendering issues in PDFs generated by Telerik WordsProcessing? -- Why does the bold text in PDFs look thicker than expected? -- How to correctly embed Arial Narrow Bold in Telerik WordsProcessing? +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`. This ensures that the library uses the appropriate font variations for bold and italic. +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, @@ -40,7 +38,7 @@ To resolve the double-bold appearance issue, manually register the correct font File.ReadAllBytes(@"C:\WINDOWS\FONTS\ARIALNBI.TTF")); ``` -2. Define a style for the references section to apply the correct font family and weight settings. +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); @@ -51,7 +49,7 @@ To resolve the double-bold appearance issue, manually register the correct font document.StyleRepository.Add(referenceStyleChar); ``` -3. Apply the style to the desired text or runs in your document. +3. Apply the style to the desired text or [Runs]({%slug radwordsprocessing-model-run%}) in your document. ```csharp foreach (var referenceParagraph in referenceParagraphs) @@ -67,7 +65,7 @@ To resolve the double-bold appearance issue, manually register the correct font } ``` -4. Use the `FontEmbeddingType.Subset` setting when exporting to PDF to avoid redundant font embedding. +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(); @@ -86,10 +84,6 @@ To resolve the double-bold appearance issue, manually register the correct font ## See Also -- [WordsProcessing Overview](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/overview) -- [PdfFormatProvider](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/pdfformatprovider/overview) -- [FontEmbeddingType Enum](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.flow.formatproviders.pdf.export.fontembeddingtype) -- [RegisterFont Method](https://docs.telerik.com/devtools/document-processing/api/telerik.windows.documents.flow.model.fonts.fontrepository#registerfont) -- [System.Windows.Media.Typeface.TryGetGlyphTypeface Issue](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.typeface.trygetglyphtypeface?redirectedfrom=MSDN) +- [Fonts in PdfProcessing]({%slug radpdfprocessing-concepts-fonts%}) diff --git a/libraries/radpdfprocessing/concepts/fonts.md b/libraries/radpdfprocessing/concepts/fonts.md index 105bbaa2..5d7f33aa 100644 --- a/libraries/radpdfprocessing/concepts/fonts.md +++ b/libraries/radpdfprocessing/concepts/fonts.md @@ -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%}) From 344cc26ec2d3e1238dbe65d9bffd479335bbd3a9 Mon Sep 17 00:00:00 2001 From: Yoan Karamanov Date: Thu, 2 Oct 2025 14:31:44 +0300 Subject: [PATCH 3/3] Update fixing-double-bold-text-issue-in-pdf-document.md --- .../fixing-double-bold-text-issue-in-pdf-document.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md index 5aac9d68..3db93f28 100644 --- a/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md +++ b/knowledge-base/fixing-double-bold-text-issue-in-pdf-document.md @@ -5,7 +5,7 @@ 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 +tags: word, processing, pdf, provider, font, embed, arial, narrow, register, bold, flow, double, export res_type: kb ticketid: 1698628 --- @@ -19,11 +19,11 @@ ticketid: 1698628 ## 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. +This knowledge base article gives some tips on 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. +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: