| C1.C1Pdf.4 Assembly > C1.C1Pdf Namespace > C1PdfDocument Class > DrawStringRtf Method : DrawStringRtf(String,Font,Brush,RectangleF) Method |
This method is similar to MeasureString(String,Font,Single), except it recognizes Rtf (Rich Text Format) strings like those used in the RichTextBox control.
There are two types of RTF strings:
1) Complete RTF strings contain an Rtf header that specifies the fonts and colors used within the string. These strings can be obtained from a RichTextBox control using the RichTextBox.Rtf property, or from Rtf files saved to disk. In this case, the font and brush parameters are not used.
2) Partial RTF strings contain embedded Rtf tags but no Rtf header. These strings are easy to build in code and can be used to render text with special attributes such as bold and italics (for example: "this text contains {\b BOLD} and {\i ITALICS}". In this case, the font and brush parameters are used to build the Rtf header automatically.
The DrawStringRtf 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. To do this, use the overload that takes the starting character in the text as a parameter.
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