Completed
Last Updated: 19 Jan 2023 14:56 by ADMIN
Release R1 2023
ADMIN
Deyan
Created on: 24 Aug 2018 12:21
Category: PdfProcessing
Type: Bug Report
4
PdfProcessing: NotImplementedException is thrown when editing and exporting text with CID font and CFF font source.

We should implement the logic for getting character codes from Unicode when using CFFFontSource. Workaround: The font may be changed by creating a similar font with FontsRepository.TryCreateFont(...) method.

Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.RegisterFont(new Telerik.Documents.Core.Fonts.FontFamily("Arial"), Telerik.Documents.Core.Fonts.FontStyles.Normal, Telerik.Documents.Core.Fonts.FontWeights.Normal, fontData); // fontData is a byte[] keeping the font definition

FontBase font;
bool hasCreatedFont = FontsRepository.TryCreateFont(new FontFamily("Arial"), out font);
 
foreach (TextField field in document.AcroForm.FormFields.OfType<TextField>())
{
    if (hasCreatedFont)
    {
        foreach (var widget in field.Widgets)
        {
            widget.TextProperties.Font = font;
        }
 
        field.TextProperties.Font = font;
    }
}

0 comments