C1.Xaml.Pdf Namespace > C1PdfDocument Class > DrawString Method : DrawString(String,Font,Color,Rect,StringFormat,Int32) Method |
'Declaration
Public Overloads Function DrawString( _ ByVal text As String, _ ByVal font As Font, _ ByVal color As Color, _ ByVal rc As Rect, _ ByVal fmt As StringFormat, _ ByVal start As Integer _ ) As Integer
'Usage
Dim instance As C1PdfDocument Dim text As String Dim font As Font Dim color As Color Dim rc As Rect Dim fmt As StringFormat Dim start As Integer Dim value As Integer value = instance.DrawString(text, font, color, rc, fmt, start)
The fmt parameter contains properties that specify formatting options. Use the StringFormat.Alignment property to specify horizontal alignment and the StringFormat.LineAlignment property to specify vertical alignment.
Use the StringFormat.FormatFlags property to specify clipping and wrapping.
Use the StringFormat.Angle property to render text at an angle.
The DrawString method returns the index of the first character that was not printed because it did not fit the output rectangle. You can use this value to make text flow from page to page, or from one frame to another within a page.
Due to platform limitations, the Silverlight and WinRT versions of C1Pdf cannot render the full Unicode character set. In these versions of C1Pdf, the DrawString method will only render the "Latin2" character set (characters commonly used in the USA/Canada and Western Europe).
// render string spanning multiple pages for (int start = 0; start < int.MaxValue;) { // render as much as will fit into the rectangle start = _c1pdf.DrawString(text, font, Brushes.Black, rcPage, start); // move on to the next page _c1pdf.NewPage(); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2