# GrapeCity.Documents.Drawing.GcGraphics.DrawString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString*">DrawString Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_System_String_GrapeCity_Documents_Text_TextFormat_System_Drawing_PointF_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString(System.String,GrapeCity.Documents.Text.TextFormat,System.Drawing.PointF)">DrawString(string, TextFormat, PointF)</h4>
<div class="markdown level1 summary"><p>Draws a string using a specified <a class="xref" href="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a> at a specified location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawString(string text, TextFormat textFormat, PointF location)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawString(text As String, textFormat As TextFormat, location As PointF)</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="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>The text format to use.</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">location</span></td>
      <td><p>The location to draw at.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_System_String_GrapeCity_Documents_Text_Font_System_Single_System_Drawing_Color_System_Drawing_PointF_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString(System.String,GrapeCity.Documents.Text.Font,System.Single,System.Drawing.Color,System.Drawing.PointF)">DrawString(string, Font, float, Color, PointF)</h4>
<div class="markdown level1 summary"><p>Draws a string using a specified attributes at a specified location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawString(string text, Font font, float fontSize, Color foreColor, PointF location)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawString(text As String, font As Font, fontSize As Single, foreColor As Color, location As PointF)</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="GrapeCity.Documents.Text.Font.html">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>The font.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">fontSize</span></td>
      <td><p>The font size.</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">foreColor</span></td>
      <td><p>The text color.</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">location</span></td>
      <td><p>The location to draw at.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcGraphics_DrawString_System_String_GrapeCity_Documents_Text_TextFormat_System_Drawing_RectangleF_GrapeCity_Documents_Text_TextAlignment_GrapeCity_Documents_Text_ParagraphAlignment_System_Boolean_" data-uid="GrapeCity.Documents.Drawing.GcGraphics.DrawString(System.String,GrapeCity.Documents.Text.TextFormat,System.Drawing.RectangleF,GrapeCity.Documents.Text.TextAlignment,GrapeCity.Documents.Text.ParagraphAlignment,System.Boolean)">DrawString(string, TextFormat, RectangleF, TextAlignment, ParagraphAlignment, bool)</h4>
<div class="markdown level1 summary"><p>Draws a string using a specified <a class="xref" href="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a> within a rectangle
using a specified text alignment, paragraph alignment and word wrapping flag.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void DrawString(string text, TextFormat textFormat, RectangleF rect, TextAlignment textAlignment = TextAlignment.Leading, ParagraphAlignment paragraphAlignment = ParagraphAlignment.Near, bool wordWrap = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub DrawString(text As String, textFormat As TextFormat, rect As RectangleF, Optional textAlignment As TextAlignment = TextAlignment.Leading, Optional paragraphAlignment As ParagraphAlignment = ParagraphAlignment.Near, Optional wordWrap As Boolean = True)</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="GrapeCity.Documents.Text.TextFormat.html">TextFormat</a></td>
      <td><span class="parametername">textFormat</span></td>
      <td><p>The text format to use.</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">rect</span></td>
      <td><p>The target rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Text.TextAlignment.html">TextAlignment</a></td>
      <td><span class="parametername">textAlignment</span></td>
      <td><p>The text alignment (<a class="xref" href="GrapeCity.Documents.Text.TextAlignment.html#GrapeCity_Documents_Text_TextAlignment_Leading">Leading</a> by default).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Text.ParagraphAlignment.html">ParagraphAlignment</a></td>
      <td><span class="parametername">paragraphAlignment</span></td>
      <td><p>The paragraph alignment (<a class="xref" href="GrapeCity.Documents.Text.ParagraphAlignment.html#GrapeCity_Documents_Text_ParagraphAlignment_Near">Near</a> by default).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">wordWrap</span></td>
      <td><p>Whether to use word wrapping (true by default).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
