Namespace: PdfSharp.Drawing.Layout
Represents a very simple text formatter. If this class does not satisfy your needs on formatting paragraphs, I recommend taking a look at MigraDoc Foundation. Alternatively, you should copy this class in your own source code and modify it.
public class XTextFormatter
Inheritance Object → XTextFormatter
Gets or sets the text.
public string Text { get; set; }
String
The text.
Gets or sets the font.
public XFont Font { get; set; }
Gets or sets the bounding box of the layout.
public XRect LayoutRectangle { get; set; }
Gets or sets the alignment of the text.
public XParagraphAlignment Alignment { get; set; }
Initializes a new instance of the XTextFormatter class.
public XTextFormatter(XGraphics gfx)
gfx XGraphics
Draws the text.
public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle)
text String
The text to be drawn.
font XFont
The font.
brush XBrush
The text brush.
layoutRectangle XRect
The layout rectangle.
Draws the text.
public void DrawString(string text, XFont font, XBrush brush, XRect layoutRectangle, XStringFormat format)
text String
The text to be drawn.
font XFont
The font.
brush XBrush
The text brush.
layoutRectangle XRect
The layout rectangle.
format XStringFormat
The format. Must be XStringFormat.TopLeft