Table of Contents

Class RepStringMM

Namespace
Root.ReportNet.Pdf
Assembly
ReportNet.dll

Represents a string object for a single-line text in a PDF report, where the dimensions are in millimeters.

public class RepStringMM : RepString
Inheritance
RepStringMM
Inherited Members

Examples

StandardFontDef fontDef = new(StandardFont.Helvetica);
FontProp font = new(fontDef, 10);
RepStringMM rs = new(font, "abcdefghijklmn", 17.6, TextOptions.EllipsisIfTooLong);

Result: abcdefg…

Constructors

RepStringMM(FontProp, string, double, TextOptions)

Initializes a new instance of the RepStringMM class with the specified font, text, maximum width and text options.

public RepStringMM(FontProp font, string text, double widthMaxMM, TextOptions options = TextOptions.SmallerFontIfToolLong)

Parameters

font FontProp

The font for the string.

text string

The single-line text.

widthMaxMM double

The maximum width of the string in millimeters.

options TextOptions

The text options for the string. The default value is SmallerFontIfToolLong.

Remarks

Supported text options:

TextOptionDescription
TruncateIfTooLongIf the text is longer than the specified width, it is truncated.
EllipsisIfTooLongIf the text is longer than the specified width, it is truncated by ellipsis.
SmallerFontIfToolLongIf the text is longer than the specified width, the font is scaled down.

Exceptions

ArgumentNullException

The font or text is null.

ArgumentException

Invalid option: None>, Center, Right or AdjustWidth are not allowed.

See Also