Click or drag to resize

PdfFontResource Constructor (String, String, String)

Create a new PDF font resource used by the PdfWebControl and other aspects of RAD PDF.

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: 3.48.0.0 (3.48.0.0)
Syntax
public PdfFontResource(
	string displayName,
	string cssName,
	string trueTypeName
)

Parameters

displayName
Type: SystemString
The name of the font resource when displayed to the user.
cssName
Type: SystemString
The CSS font family used for displaying text in this font in a web browser.
trueTypeName
Type: SystemString
The name of the TrueType font used when adding a PdfTextShape or PdfField to a PDF.
Remarks

If a displayName is used containing the words "Arial", "Courier", "Helvetica" or "Times", RAD PDF may automatically substitute one of the four default fonts if the default fonts are not removed using Remove(PdfFontResource) or Clear.

The cssName parameter can be a single client side font resource or several font names as a "fallback" system. If the client's browser does not support the first font, it tries the next font, in order from left to right. It is typically best to end with a generic family (e.g. sans-serif, serif, monospace). In most cases, font family names may be either quoted (e.g. 'Courier New', 'Courier'), or unquoted (e.g. Courier New, Courier). Font family names containing most punctuation characters and digits should be quoted or escaped. Meaning that the string literal "39 Tall Text" will not work in some browsers; instead "\'39 Tall Text\'" should be used.

The trueTypeName parameter must be the exact name of a TrueType font family installed on the server running RAD PDF. The font must have permissions allowing the font to be embedded.

Examples
The following example creates a new font resource:
C#
new FontResource("Comic Sans", "Comic Sans, Arial, sans-serif", "Comic Sans MS");
See Also