# C1.C1Pdf.C1PdfDocument.DrawStringHtml

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Pdf_C1PdfDocument_DrawStringHtml_" data-uid="C1.C1Pdf.C1PdfDocument.DrawStringHtml*">DrawStringHtml Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Pdf_C1PdfDocument_DrawStringHtml_" data-uid="C1.C1Pdf.C1PdfDocument.DrawStringHtml*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawStringHtml_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawStringHtml(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF)">DrawStringHtml(string, Font, Brush, RectangleF)</h4>
<div class="markdown level1 summary"><p>Draws an HTML string in the specified rectangle with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> objects.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawStringHtml(string text, Font font, Brush brush, RectangleF rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawStringHtml(text As String, font As Font, brush As Brush, rc As RectangleF) As Integer</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>HTML string to draw.</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 drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</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>
  </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.int32">int</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.int32.maxvalue">MaxValue</a> if the entire string was rendered.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawStringHtml_" data-uid="C1.C1Pdf.C1PdfDocument.DrawStringHtml*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawStringHtml_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_" data-uid="C1.C1Pdf.C1PdfDocument.DrawStringHtml(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Int32)">DrawStringHtml(string, Font, Brush, RectangleF, int)</h4>
<div class="markdown level1 summary"><p>Draws an HTML string in the specified rectangle with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">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 int DrawStringHtml(string text, Font font, Brush brush, RectangleF rc, int offset)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawStringHtml(text As String, font As Font, brush As Brush, rc As RectangleF, offset As Integer) As Integer</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>HTML string to draw.</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 drawn text.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a></td>
      <td><span class="parametername">brush</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</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.int32">int</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.int32">int</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.int32.maxvalue">MaxValue</a> if the entire string was rendered.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
