# GrapeCity.Documents.Text.TextLayout.Truncate

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Text_TextLayout_Truncate_" data-uid="GrapeCity.Documents.Text.TextLayout.Truncate*">Truncate Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Text_TextLayout_Truncate_" data-uid="GrapeCity.Documents.Text.TextLayout.Truncate*"></a>
<h4 id="GrapeCity_Documents_Text_TextLayout_Truncate_GrapeCity_Documents_Text_TrimmingGranularity_" data-uid="GrapeCity.Documents.Text.TextLayout.Truncate(GrapeCity.Documents.Text.TrimmingGranularity)">Truncate(TrimmingGranularity)</h4>
<div class="markdown level1 summary"><p>If a portion of the text content does not fit into the current layout bounds,
removes that portion so that the remaining text fits.</p>
<p>
If the text is truncated and <code class="paramref">lastLineTrimming</code> is not <a class="xref" href="GrapeCity.Documents.Text.TrimmingGranularity.html#GrapeCity_Documents_Text_TrimmingGranularity_None">None</a>,
ellipsis (specified by <a class="xref" href="GrapeCity.Documents.Text.TextLayout.EllipsisCharCode.html#GrapeCity_Documents_Text_TextLayout_EllipsisCharCode">EllipsisCharCode</a>) is appended to the last line
to indicate that it was trimmed.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool Truncate(TrimmingGranularity lastLineTrimming = TrimmingGranularity.None)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Truncate(Optional lastLineTrimming As TrimmingGranularity = TrimmingGranularity.None) As Boolean</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="GrapeCity.Documents.Text.TrimmingGranularity.html">TrimmingGranularity</a></td>
      <td><span class="parametername">lastLineTrimming</span></td>
      <td><p>The text granularity used when trimming the last line of 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.boolean">bool</a></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> if at least some text remains that fits into the current layout bounds,
<a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> if the current layout did not contain any text or all text had to be removed.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Text_TextLayout_Truncate_GrapeCity_Documents_Text_TrimmingGranularity__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Note that if there is only one line, and it does not fit into the available height, it is not removed,
and this method returns <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.</p>
</div>
</div>
