# C1.Pdf.C1PdfDocument.DrawStringRtf

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Pdf_C1PdfDocument_DrawStringRtf_" data-uid="C1.Pdf.C1PdfDocument.DrawStringRtf*">DrawStringRtf Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Pdf_C1PdfDocument_DrawStringRtf_" data-uid="C1.Pdf.C1PdfDocument.DrawStringRtf*"></a>
<h4 id="C1_Pdf_C1PdfDocument_DrawStringRtf_System_String_System_Drawing_Color_System_Drawing_RectangleF_System_Single_" data-uid="C1.Pdf.C1PdfDocument.DrawStringRtf(System.String,System.Drawing.Color,System.Drawing.RectangleF,System.Single)">DrawStringRtf(string, Color, RectangleF, float)</h4>
<div class="markdown level1 summary"><p>Draws an RTF string in the specified rectangle with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a> and <a class="xref" href="C1.Util.Font.html">Font</a> objects,
starting at a given offset within the string.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float DrawStringRtf(string text, Color color, RectangleF rc, float offset = 0)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawStringRtf(text As String, color As Color, rc As RectangleF, Optional offset As Single = 0) As Single</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>RTF string to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a> object that defines the color of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the drawn text, in points from the top left corner of the page.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">offset</span></td>
      <td><p>Offset of the first line to draw (usually the return value of a previous call to <b>DrawStringHtml</b>).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The offset of the first line that was not printed because it did not fit in the specified rectangle, or the value of
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single.maxvalue">MaxValue</a> if the entire string was rendered.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Pdf_C1PdfDocument_DrawStringRtf_" data-uid="C1.Pdf.C1PdfDocument.DrawStringRtf*"></a>
<h4 id="C1_Pdf_C1PdfDocument_DrawStringRtf_System_String_C1_Util_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Single_" data-uid="C1.Pdf.C1PdfDocument.DrawStringRtf(System.String,C1.Util.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Single)">DrawStringRtf(string, Font, Color, RectangleF, float)</h4>
<div class="markdown level1 summary"><p>Draws an RTF string in the specified rectangle with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a> and <a class="xref" href="C1.Util.Font.html">Font</a> objects,
starting at a given offset within the string.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public float DrawStringRtf(string text, Font font, Color color, RectangleF rc, float offset = 0)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawStringRtf(text As String, font As Font, color As Color, rc As RectangleF, Optional offset As Single = 0) As Single</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>RTF string to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Util.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p><a class="xref" href="C1.Util.Font.html">Font</a> object that defines the appearance and size of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">Color</a> object that defines the color of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a></td>
      <td><span class="parametername">rc</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectanglef">RectangleF</a> structure that specifies the location of the drawn text, in points from the top left corner of the page.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">offset</span></td>
      <td><p>Offset of the first line to draw (usually the return value of a previous call to <b>DrawStringHtml</b>).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><p>The offset of the first line that was not printed because it did not fit in the specified rectangle, or the value of
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single.maxvalue">MaxValue</a> if the entire string was rendered.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Util.IFlowDocument.DrawStringRtf.html#C1_Util_IFlowDocument_DrawStringRtf_System_String_C1_Util_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Single_">IFlowDocument.DrawStringRtf(string, Font, Color, RectangleF, float)</a></div>
</div>
