# C1.C1Pdf.C1PdfDocument.MeasureStringRtf

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_" data-uid="C1.C1Pdf.C1PdfDocument.MeasureStringRtf*">MeasureStringRtf Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_" data-uid="C1.C1Pdf.C1PdfDocument.MeasureStringRtf*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_System_String_System_Drawing_Font_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.MeasureStringRtf(System.String,System.Drawing.Font,System.Single)">MeasureStringRtf(string, Font, float)</h4>
<div class="markdown level1 summary"><p>Measures an RTF string when drawn with a given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> object
into a rectangle with the specified width.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureStringRtf(string text, Font font, float width)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureStringRtf(text As String, font As Font, width As Single) As SizeF</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>String to measure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> object that defines the appearance and size of the text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>Maximum width of the string.</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.drawing.sizef">SizeF</a></td>
      <td><p>The size of the string expressed in points.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_System_String_System_Drawing_Font_System_Single__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method is similar to <a class="xref" href="C1.C1Pdf.C1PdfDocument.MeasureString.html#C1_C1Pdf_C1PdfDocument_MeasureString_System_String_System_Drawing_Font_System_Single_">MeasureString(string, Font, float)</a>, except it recognizes
Rtf (Rich Text Format) strings like those used in the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.richtextbox">RichTextBox</a> control.</p>
<p>For details, see the <a class="xref" href="C1.C1Pdf.C1PdfDocument.DrawStringRtf.html#C1_C1Pdf_C1PdfDocument_DrawStringRtf_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_">DrawStringRtf(string, Font, Brush, RectangleF)</a> method.</p>
</div>


<a id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_" data-uid="C1.C1Pdf.C1PdfDocument.MeasureStringRtf*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_MeasureStringRtf_System_String_System_Drawing_Font_" data-uid="C1.C1Pdf.C1PdfDocument.MeasureStringRtf(System.String,System.Drawing.Font)">MeasureStringRtf(string, Font)</h4>
<div class="markdown level1 summary"><p>Measures an RTF string when drawn with a given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public SizeF MeasureStringRtf(string text, Font font)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function MeasureStringRtf(text As String, font As Font) As SizeF</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>String to measure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> object that defines the appearance and size of the text.</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.drawing.sizef">SizeF</a></td>
      <td><p>The size of the string expressed in points.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
