Unplanned
Last Updated: 05 Dec 2023 10:38 by Rey
Rey
Created on: 05 Dec 2023 10:38
Category: PdfProcessing
Type: Bug Report
5
PdfProcessing: Fonts are not merged when merging documents
When merging documents using the RadFixedDocument`s Merge() method the fonts are not successfully merged which leads to missing characters in the produced document.

Workaround: replace the font with a full font (not a subset) before exporting to a PDF file:
byte[] data = File.ReadAllBytes("verdana.ttf");
FontFamily verdanaRegularFontFamily = new FontFamily("Verdana");
FontsRepository.RegisterFont(verdanaRegularFontFamily, FontStyles.Normal, FontWeights.Normal, data);
FontsRepository.TryCreateFont(verdanaRegularFontFamily, out FontBase verdanaRegularFont);

foreach (RadFixedPage page in mergedDocument.Pages)
{
	foreach (TextFragment textFragment in page.Content.Where(c => c is TextFragment).Cast<TextFragment>())
	{
		textFragment.Font = verdanaRegularFont;
	}
}
0 comments