Hello,
I'm using PDFSharp 1.31.1789.0 to write text to small rectangle. I'd like for the text to not word wrap if it reaches the right edge of the rectangle as it does now. Instead, I'd like to the text to be clipped / truncated. What do I need to do to get this behavior?
e.g. The following code:
Code:
Dim gfx As XGraphics = XGraphics.FromPdfPage(p)
Dim font As New XFont("Times New Roman", 10, XFontStyle.Bold)
Dim tf As New XTextFormatter(gfx)
Dim rect As New XRect(0, 0, 160, 60)
gfx.DrawRectangle(XBrushes.SeaShell, rect)
Dim s As String = String.Format("Line A{0}Line B{0}Line C: I do not want this line to wrap to the next line if there isn't space. I want it to remain on a single line and clipped on the right.{0}Line D", vbNewLine)
tf.DrawString(s, font, XBrushes.Black, rect, XStringFormats.TopLeft)
produces something like this:
Quote:
Line A
Line B
Line C: I do not want this line to
wrap to the next line if there isn't
space. I want it to remain on a single
Instead, I'd like for it to produce this:
Quote:
Line A
Line B
Line C: I do not want this line to
Line D
What do I need to do to get this output? Thanks in advanced!