# GrapeCity.Spreadsheet.Printing.PrintingContext.DrawText

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Printing_PrintingContext_DrawText_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.DrawText*">DrawText Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Printing_PrintingContext_DrawText_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.DrawText*"></a>
<h4 id="GrapeCity_Spreadsheet_Printing_PrintingContext_DrawText_System_String_GrapeCity_Spreadsheet_Font_GrapeCity_Drawing_Rectangle_GrapeCity_Drawing_Rectangle_GrapeCity_Spreadsheet_HorizontalAlignment_GrapeCity_Spreadsheet_VerticalAlignment_System_Boolean_System_Int32_System_Boolean_" data-uid="GrapeCity.Spreadsheet.Printing.PrintingContext.DrawText(System.String,GrapeCity.Spreadsheet.Font,GrapeCity.Drawing.Rectangle,GrapeCity.Drawing.Rectangle,GrapeCity.Spreadsheet.HorizontalAlignment,GrapeCity.Spreadsheet.VerticalAlignment,System.Boolean,System.Int32,System.Boolean)">DrawText(string, Font, Rectangle, Rectangle, HorizontalAlignment, VerticalAlignment, bool, int, bool)</h4>
<div class="markdown level1 summary"><p>Draws the specified text string in the specified rectangle.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public abstract void DrawText(string text, Font font, Rectangle rect, Rectangle padding, HorizontalAlignment left, VerticalAlignment bottom, bool wrapText, int rotation = 0, bool shrinkToFit = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public MustOverride Sub DrawText(text As String, font As Font, rect As Rectangle, padding As Rectangle, left As HorizontalAlignment, bottom As VerticalAlignment, wrapText As Boolean, Optional rotation As Integer = 0, Optional shrinkToFit As Boolean = False)</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><span class="xref">Font</span></td>
      <td><span class="parametername">font</span></td>
      <td><p><span class="xref">GrapeCity.Spreadsheet.Font</span> that defines the text format of the string.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Rectangle</span></td>
      <td><span class="parametername">rect</span></td>
      <td><p><span class="xref">GrapeCity.Drawing.Rectangle</span> structure that specifies the boundary of the drawn text.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Rectangle</span></td>
      <td><span class="parametername">padding</span></td>
      <td><p>The padding rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.HorizontalAlignment.html">HorizontalAlignment</a></td>
      <td><span class="parametername">left</span></td>
      <td><p>The horizontal alignment</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.VerticalAlignment.html">VerticalAlignment</a></td>
      <td><span class="parametername">bottom</span></td>
      <td><p>The vertical alignment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">wrapText</span></td>
      <td><p>the wrapText.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rotation</span></td>
      <td><p>The rotation.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">shrinkToFit</span></td>
      <td><p>The shrink to fit.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
