ActiveReports 18 .NET Edition
DevOps / Customization / PDF Font Settings for Section report in GDI
In This Topic
    PDF Font Settings for Section report in GDI
    In This Topic

    Learn about the PDF export behavior for fonts in the legacy GDI compatibility mode.

    Note: The section report PDF export does not support font factory settings. Instead, you can configure fonts using APIs in DsPdf and DsImaging.

    Default PDF Font Settings

    Font linking helps resolve the situation when fonts on a deployment machine do not have the glyphs that are used in a development environment. When you find such a glyph mismatch, there is a possibility that the PDF output on development and deployment machines may be different.

    In order to resolve this issue, the PDF export filter or the PDF rendering extension looks for the missing glyphs in the installed fonts as follows:

    Custom PDF Font Settings

    Typically, when using PDF export filters and drawing extensions in a Medium trust level environment or Azure web application, ActiveReports does not have access to the System Fonts folder due to security restrictions. Therefore, if your reports use special glyphs or non-ASCII characters that are only found in certain fonts, the PDF output may be incorrect on some machines.

    The ActiveReports custom font factory allows you to embed any fonts you need in PDF in the Medium trust environment.

    ActiveReports looks for the custom fonts in the order as follows:

    1. A font specified in the control.
    2. A mapped specified font in the Substitute setting.
    3. A font specified in the the AddFontLink setting (Pro Edition only).
    4. A font specified in the SetFallbackFont setting (Pro Edition only).

    Notice that you need to copy the required font files (.ttc, .ttf) manually into the font folder you are accessing.

    Custom Font Factory in Windows Azure

    For your Azure project, you need to set the properties for all fonts in the project Fonts folder as follows:

    1. Set Copy to Output Directory to Copy always.
    2. Set BuildAction to Content.

    Custom Font Configuration Settings

    EUDC configuration settings

    Element Description
    DefaultEUDCFont

    This is the node, like the SystemDefaultEudcFont entry in the registry file, that contains the default EUDC font settings.

    It specifies a default unique EUDC font for all fonts. It is an absolute path or a relative to the first one, found in the AddFolder setting. The same role as the "SystemDefaultEudcFont" entry in the registry - see https://learn.microsoft.com/en-us/windows/win32/intl/eudc.

    DefaultEUDCFont File Specifies the file name of the default EUDC file.
    AddEudcFont

    This is the node that associates the EUDC file and the fontname. This node can be added more than once. See https://learn.microsoft.com/en-us/windows/win32/intl/eudc.

    AddEudcFont Font  Specifies the font name. 
    AddEudcFont File

    Specifies the file name of the EUDC file to associate the above font.

    FontFactory

    This is the main font factory node to which you can add fonts.

    Attributes

    Element Description
    Mode

    Setting the Mode attribute to File allows to use a file based factory, or remove the attribute for a Windows GDI factory.

    Child Elements

    None.

    Parent Elements

    Element Description
    ActiveReports.PdfExport

    The assembly that contains the PdfExport namespace (PDF export, document options, and security classes).

    Example

    <FontFactory Mode="File">
    

    AddFolder

    Adds all TrueType fonts (.ttc, .ttf) from the specified folder.

    Attributes

    Element Description
    Path

    Specifies the absolute path to the folder.

    VirtualPath Specifies the relative path to the folder.
    Recurse When set to True, it can read the subfolder. When set to False, it cannot read the subfolder.

    Child Elements

    None.

    Parent Elements

    Element Description
    FontFactory

    This is the main font factory node to which you can add fonts.

    Example

    <AddFolder VirtualPath="~/Fonts" Recurse="true"/>
    

    Substitute

    Maps an alternate name of fonts to their official names.

    Attributes

    Element Description
    Font

    Specifies the abbreviated font name (e.g. "Helv").

    To Specifies the official font name (e.g. "Helvetica").

    Child Elements

    None.

    Parent Elements

    Element Description
    FontFactory

    This is the main font factory node to which you can add fonts.

    Example

     <Substitute Font="Helv" To="Helvetica"/>
    

    SetFallbackFont (Professional Edition only)

    In the Professional Edition, sets the font to use if a) the specified font is not installed, b) the Substitute font is not specified or not installed, or c) the font links are not set or the needed glyphs are not found in the AddFontLink setting. Substitute adds a font substitution entry. See https://learn.microsoft.com/en-us/globalization/fonts-layout/fonts and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes registry key.

    Attributes

    Element Description
    Font

    Specifies the font name.

    Child Elements

    None.

    Parent Elements

    Element Description
    FontFactory

    This is the main font factory node to which you can add fonts.

    Example

     <SetFallbackFont Font="Arial"/> 
    

    AddFontLink (Professional Edition only)

    In the Professional Edition, there is the extra support for CJK glyphs. You can add font links that allow the PdfExport to look up any glyphs missing from the specified font in the list of other fonts to check.

    Attributes

    Element Description
    Font

    Specifies the font used in the reports.

    List

    Specifies the comma-separated list of fonts to be used in case of missing glyphs, specified in the Font attribute. See https://learn.microsoft.com/en-us/globalization/fonts-layout/fonts and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink registry key.

    Caution: The character style of the link won't be outputted in case the alternate font file does not exist in the specified folder of the AddFolder setting.
    IsDefault When set to True, indicates to use the specified list for any fonts that do not have their own font links.

    Child Elements

    None.

    Parent Elements

    Element Description
    FontFactory

    This is the main font factory node to which you can add fonts.

    Example

     <AddFontLink Font="Tahoma" List="MS UI Gothic,SimSun,gulim,PMingLiU"/>
    
    See Also