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.
To add a font factory section group
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> |
To create a font factory
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"/>. |
To set up a Medium trust environment
XML code. Paste BETWEEN the system.web tags. |
Copy Code |
---|---|
<trust level="Medium"></trust> |
Table 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.
| ||
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:
|