ActiveReports 6 Online Help
Custom Font Factory (Pro Edition)
See Also Send comments on this topic.
ActiveReports 6 > ActiveReports User Guide > Concepts > Export Filters > PDF > Custom Font Factory (Pro Edition)

Glossary Item Box

When you use the PDF export filter in a Medium trust environment, ActiveReports does not have access to the System Fonts folder. So 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. To deploy the necessary fonts with your Medium trust solution, you can create a custom font factory in your web.config file.

ShowTo add a font factory section group

Paste between the <configSections> and </configSections> tags.
XML code. Paste INSIDE the configSections tags. Copy Code
<sectionGroup name="ActiveReports.PdfExport">
    <section name="FontFactory" 
        type="DataDynamics.ActiveReports.Web.FontFactorySectionHandler,ActiveReports.Web,
        Version=6.0.2227.0, Culture=neutral,PublicKeyToken=cc4967777c49a3ff"
        requirePermission="false"/>
</sectionGroup> 

ShowTo create a font factory

Paste code like the following after the </configSections> tag, but before the <appSettings/> tag.
XML code. Paste between configSections and appSettings. Copy Code
<ActiveReports.PdfExport>
    <FontFactory Mode="File">
        <AddFolder VirtualPath="~/Fonts" Recurse="true"/>
        <Substitute Font="Helv" To="Helvetica"/>
        <SetFallbackFont Font="Arial"/>
        <!-- font link nodes -->
        <AddFontLink Font="Arial" List="SimSun,gulim,PMingLiU"/>
        <AddFontLink Font="Tahoma" List="MS UI Gothic,SimSun,gulim,PMingLiU"/>
        <AddFontLink Font="MS UI Gothic" List="SimSun,gulim,PMingLiU,Microsoft Sans Serif" IsDefault="true"/>
    </FontFactory>
</ActiveReports.PdfExport>

Note: For the Azure worker role project, use an absolute path instead of a virtual path in the code above:

<AddFolder Path="~/Fonts" Recurse="true"/>.

ShowTo set up a Medium trust environment

Paste the following code between the <system.web> and </system.web> tags.
XML code. Paste BETWEEN the system.web tags. Copy Code
<trust level="Medium"></trust>

ShowTable of configuration settings

Setting Description Attributes
FontFactory This is the main font factory node to which you can add fonts. Mode: Set to "File" to use a file based factory, or remove the attribute for a Windows GDI factory.
Note: EUDC fonts are not yet supported in "File" mode.
AddFolder Adds all TrueType fonts from the specified folder. Path: Specify the absolute path to the folder.
VirtualPath: Specify the relative path to the folder.
Recurse: Set to "true" to have the factory read folders recursively.
Substitute Maps alternate spellings of fonts to their official names. Font: The abbreviated font name (e.g. "Helv").
To: The official font name (e.g. "Helvetica").
SetFallbackFont
Professional Edition only

In the Professional Edition, sets the font to use in cases where:

a) the specified font is not installed,

b) the Substitute font is not specified or not installed,

c) the font links are not set or the needed glyphs are not found in the AddFontLink setting.

Font: The font name.
AddFontLink
Professional Edition only

In the Professional Edition, there is 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.

Font: The font used in the reports.
List: The comma-separated list of fonts in which to look for missing glyphs.
IsDefault: Set this to "true" to use the specified List for any fonts that do not have their own font links set.
Note: For additional information on the SetFallbackFont and AddFontLink settings, see Font Linking.

Note: For the Azure project, 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.

See Also