PDFTextEngine¶
Namespace: O2S.Components.PDF4NET.Graphics.Text
Provides various services related to text layout on PDF pages.
Inheritance Object → PDFTextEngine
Methods¶
GetStringHeight(String, PDFFont, Double)¶
Gets the height of the string wrapped at the specified width.
Parameters
s String
String to measure.
font PDFFont
Font used to draw the string.
width Double
Maximum width for wrapping.
Returns
Double
The total height of the text lines.
GetStringHeight(String, PDFFont, Double, Boolean)¶
Gets the height of the string wrapped at the specified width.
Parameters
s String
String to measure.
font PDFFont
Font used to draw the string.
width Double
Maximum width for wrapping.
forceLongWordsWrap Boolean
True if long words are wrapped at character level if they do not fit entirely on a single line.
Returns
Double
The total height of the text lines.
GetStringHeight(String, PDFFont, PDFStringLayoutOptions)¶
Gets the height of the string wrapped at the specified width.
Parameters
s String
String to measure.
font PDFFont
Font used to draw the string.
slo PDFStringLayoutOptions
Layout options that affect the string
Returns
Double
The total height of the text lines.
GetStringInBox(String, PDFFont, Double, Double)¶
Gets the string that fits in the given box.
Parameters
s String
String to wrap in the box.
font PDFFont
Font used to draw the string.
width Double
The box width.
height Double
The box height.
Returns
String
The number of characters in the string that fit in the given box.
GetStringInBox(String, PDFFont, Double, Double, Boolean)¶
Gets the string that fits in the given box.
public static string GetStringInBox(string s, PDFFont font, double width, double height, bool forceLongWordsWrap)
Parameters
s String
String to wrap in the box.
font PDFFont
Font used to draw the string.
width Double
The box width.
height Double
The box height.
forceLongWordsWrap Boolean
True if long words are wrapped at character level if they do not fit entirely on a single line.
Returns
String
The number of characters in the string that fit in the given box.
GetStringInBox(String, PDFFont, PDFStringLayoutOptions)¶
Gets the string that fits in the given box.
Parameters
s String
String to wrap in the box.
font PDFFont
Font used to draw the string.
slo PDFStringLayoutOptions
Layout options that affect the string
Returns
String
The string that fit in the given box.
MeasureString(String, PDFFont)¶
Measures the specified string.
Parameters
s String
String to measure.
font PDFFont
Font used to display the string.
Returns
PDFSize
The size of the string when displayed using the font.
WrapString(String, PDFFont, Double)¶
Wraps the string at the given width.
Parameters
s String
String to wrap.
font PDFFont
Font used to draw the text.
width Double
Maximum width for wrapping.
Returns
PDFTextLineCollection
A collection of text lines representing the wrapped text.
WrapString(String, PDFFont, Double, Boolean)¶
Wraps the string at the given width.
public static PDFTextLineCollection WrapString(string s, PDFFont font, double width, bool forceLongWordsWrap)
Parameters
s String
String to wrap.
font PDFFont
Font used to draw the text.
width Double
Maximum width for wrapping.
forceLongWordsWrap Boolean
True if long words are wrapped at character level if they do not fit entirely on a single line.
Returns
PDFTextLineCollection
A collection of text lines representing the wrapped text.
WrapString(String, PDFFont, PDFStringLayoutOptions)¶
Wraps the string at the given width.
public static PDFTextLineCollection WrapString(string s, PDFFont font, PDFStringLayoutOptions stringLayoutOptions)
Parameters
s String
String to wrap.
font PDFFont
Font used to draw the text.
stringLayoutOptions PDFStringLayoutOptions
Options for text layout.
Returns
PDFTextLineCollection
A collection of text lines representing the wrapped text.