# C1.C1Pdf.C1PdfDocument.DrawString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*">DrawString Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Int32,System.Drawing.StringFormat)">DrawString(string, Font, Brush, RectangleF, int, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Brush brush, RectangleF rc, int firstChar, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, rc As RectangleF, firstChar As Integer, sf As StringFormat) 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>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>The rectangle 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">firstChar</span></td>
      <td><p>Index of the first character that will be rendered.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The <code class="paramref">sf</code> contains properties that specify formatting options. Use the
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat.alignment">Alignment</a> property to specify horizontal alignment and the
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat.linealignment">LineAlignment</a> property to specify vertical alignment.</p>
<p>Use the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat.formatflags">FormatFlags</a> property to specify clipping and wrapping.</p>
<p>To render text in the vertical direction, use the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformatflags#system-drawing-stringformatflags-directionvertical">DirectionVertical</a>.
By itself, this flag will cause text to render from the bottom to the top of the rectangle.
Combined with the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformatflags#system-drawing-stringformatflags-directionrighttoleft">DirectionRightToLeft</a> flags, it will cause text to render from
the top to the bottom of the rectangle.</p>
<p>The <b>DrawString</b> 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.</p>
</div>
<h5 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat__examples">Examples</h5>
<p>The code below renders a long string into several pages, using the return value
from the <b>DrawString</b> method to determine where to continue printing.</p>
<pre><code class="lang-csharp">// render string spanning multiple pages
for (int start = 0; start &lt; 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();
}</code></pre>



<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Int32,System.Drawing.StringFormat)">DrawString(string, Font, Color, RectangleF, int, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Color color, RectangleF rc, int firstChar, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, rc As RectangleF, firstChar As Integer, sf As StringFormat) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>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>The rectangle 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">firstChar</span></td>
      <td><p>Index of the first character that will be rendered.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Int32,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Brush, RectangleF, int, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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>,
using the formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object
and specified character width coefficient.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Brush brush, RectangleF rc, int firstChar, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, rc As RectangleF, firstChar As Integer, sf As StringFormat, widthCoeff As Single) 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>The 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>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> used to draw the 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>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a> specifying the text color.</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>The rectangle specifying the location of the 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">firstChar</span></td>
      <td><p>The index of the first character that will be rendered.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object specifying the formatting attributes applied to 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">widthCoeff</span></td>
      <td><p>The width coefficient applied to characters. The default is 1.0, use 2.0 for double width and so on.</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 index of the first character that was not rendered because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Int32_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Int32,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Color, RectangleF, int, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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>,
using the formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object
and specified character width coefficient.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Color color, RectangleF rc, int firstChar, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, rc As RectangleF, firstChar As Integer, sf As StringFormat, widthCoeff As Single) 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>The 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>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> used to draw the 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>The text color.</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>The rectangle specifying the location of the 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">firstChar</span></td>
      <td><p>The index of the first character that will be rendered.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object specifying the formatting attributes applied to 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">widthCoeff</span></td>
      <td><p>The width coefficient applied to characters. The default is 1.0, use 2.0 for double width and so on.</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 index of the first character that was not rendered because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Drawing.StringFormat)">DrawString(string, Font, Color, RectangleF, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Color color, RectangleF rc, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, rc As RectangleF, sf As StringFormat) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>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>The rectangle 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.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat)">DrawString(string, Font, Brush, RectangleF, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Brush brush, RectangleF rc, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, rc As RectangleF, sf As StringFormat) 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>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>The 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>The rectangle 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.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Color, RectangleF, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Color color, RectangleF rc, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, rc As RectangleF, sf As StringFormat, widthCoeff As Single) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>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>The rectangle 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.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Brush, RectangleF, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Brush brush, RectangleF rc, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, rc As RectangleF, sf As StringFormat, widthCoeff As Single) 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>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>The 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>The rectangle 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.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_System_Int32_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF,System.Int32)">DrawString(string, Font, Color, RectangleF, int)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Color color, RectangleF rc, int firstChar)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, rc As RectangleF, firstChar 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>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>The rectangle 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">firstChar</span></td>
      <td><p>Index of the first character that will be rendered.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_System_Int32_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Int32)">DrawString(string, Font, Brush, RectangleF, int)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Brush brush, RectangleF rc, int firstChar)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, rc As RectangleF, firstChar 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>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>The 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>The rectangle 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">firstChar</span></td>
      <td><p>Index of the first character that will be rendered.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.RectangleF)">DrawString(string, Font, Color, RectangleF)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 DrawString(string text, Font font, Color color, RectangleF rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>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>The rectangle 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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_RectangleF__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This overload renders strings aligned to the top left corner of the specified rectangle,
wrapping text as needed within the rectangle, without clipping, and in the horizontal
direction. To change any of these defaults, use the overload that allows you to specify
a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> parameter.</p>
</div>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF)">DrawString(string, Font, Brush, RectangleF)</h4>
<div class="markdown level1 summary"><p>Draws the specified text 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 DrawString(string text, Font font, Brush brush, RectangleF rc)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(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>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>The 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>The rectangle 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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_RectangleF__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This overload renders strings aligned to the top left corner of the specified rectangle,
wrapping text as needed within the rectangle, without clipping, and in the horizontal
direction. To change any of these defaults, use the overload that allows you to specify
a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> parameter.</p>
</div>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_PointF_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.PointF,System.Drawing.StringFormat)">DrawString(string, Font, Color, PointF, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Color color, PointF pt, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, pt As PointF, sf As StringFormat) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point structure that specifies the location of the drawn text, in points</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_PointF_System_Drawing_StringFormat_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF,System.Drawing.StringFormat)">DrawString(string, Font, Brush, PointF, StringFormat)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</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 int DrawString(string text, Font font, Brush brush, PointF pt, StringFormat sf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, pt As PointF, sf As StringFormat) 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>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>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point structure that specifies the location of the drawn text, in points</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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.int32">int</a></td>
      <td><p>The index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_PointF_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.PointF,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Color, PointF, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object
and specified width coefficient of text characters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Color color, PointF pt, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, pt As PointF, sf As StringFormat, widthCoeff As Single) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point structure that specifies the location of the drawn text, in points</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_PointF_System_Drawing_StringFormat_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF,System.Drawing.StringFormat,System.Single)">DrawString(string, Font, Brush, PointF, StringFormat, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 using the
formatting attributes of the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object
and specified width coefficient of text characters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Brush brush, PointF pt, StringFormat sf, float widthCoeff)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, pt As PointF, sf As StringFormat, widthCoeff As Single) 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>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>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point structure that specifies the location of the drawn text, in points</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a></td>
      <td><span class="parametername">sf</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.stringformat">StringFormat</a> object that specifies formatting attributes applied to the drawn 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0.</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_PointF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.PointF)">DrawString(string, Font, Color, PointF)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 DrawString(string text, Font font, Color color, PointF pt)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, pt As PointF) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point 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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_PointF_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF)">DrawString(string, Font, Brush, PointF)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point 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 DrawString(string text, Font font, Brush brush, PointF pt)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, pt As PointF) 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>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>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point 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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Color_System_Drawing_PointF_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Color,System.Drawing.PointF,System.Single)">DrawString(string, Font, Color, PointF, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point with the
specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> objects
and specified width coefficient of text characters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Color color, PointF pt, float widthCoeff = 1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, color As Color, pt As PointF, Optional widthCoeff As Single = 1) 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>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.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0..</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_C1Pdf_C1PdfDocument_DrawString_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString*"></a>
<h4 id="C1_C1Pdf_C1PdfDocument_DrawString_System_String_System_Drawing_Font_System_Drawing_Brush_System_Drawing_PointF_System_Single_" data-uid="C1.C1Pdf.C1PdfDocument.DrawString(System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF,System.Single)">DrawString(string, Font, Brush, PointF, float)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string at the specified point with the
specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.brush">Brush</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a> objects
and specified width coefficient of text characters.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int DrawString(string text, Font font, Brush brush, PointF pt, float widthCoeff = 1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function DrawString(text As String, font As Font, brush As Brush, pt As PointF, Optional widthCoeff As Single = 1) 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>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>The 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.pointf">PointF</a></td>
      <td><span class="parametername">pt</span></td>
      <td><p>The point 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">widthCoeff</span></td>
      <td><p>The width coefficient of text characters, by default 1.0, for double width 2.0..</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 index of first character that was not printed because it did not fit in the specified rectangle.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
