Class RepStringMM
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
FontPropThe font for the string.
text
stringThe single-line text.
widthMaxMM
doubleThe maximum width of the string in millimeters.
options
TextOptionsThe text options for the string. The default value is SmallerFontIfToolLong.
Remarks
Supported text options:
TextOption | Description |
---|---|
TruncateIfTooLong | If the text is longer than the specified width, it is truncated. |
EllipsisIfTooLong | If the text is longer than the specified width, it is truncated by ellipsis. |
SmallerFontIfToolLong | If 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
orAdjustWidth
are not allowed.