# C1.Document.Unit.Convert

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Document_Unit_Convert_" data-uid="C1.Document.Unit.Convert*">Convert Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Document_Unit_Convert_" data-uid="C1.Document.Unit.Convert*"></a>
<h4 id="C1_Document_Unit_Convert_C1_Document_UnitTypeEnum_" data-uid="C1.Document.Unit.Convert(C1.Document.UnitTypeEnum)">Convert(UnitTypeEnum)</h4>
<div class="markdown level1 summary"><p>Converts value of this <a class="xref" href="C1.Document.Unit.html">Unit</a> structure to value in specified units of measurement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public double Convert(UnitTypeEnum to)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Convert([to] As UnitTypeEnum) As Double</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="C1.Document.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">to</span></td>
      <td><p>The target unit of measurement.</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.double">double</a></td>
      <td><p>Returns the value in <code class="paramref">to</code> units.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Document_Unit_Convert_" data-uid="C1.Document.Unit.Convert*"></a>
<h4 id="C1_Document_Unit_Convert_System_Double_System_Double_C1_Document_UnitTypeEnum_" data-uid="C1.Document.Unit.Convert(System.Double,System.Double,C1.Document.UnitTypeEnum)">Convert(double, double, UnitTypeEnum)</h4>
<div class="markdown level1 summary"><p>Converts a value from pixel unit of measurement to another.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static double Convert(double value, double fromDpi, UnitTypeEnum to)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Convert(value As Double, fromDpi As Double, [to] As UnitTypeEnum) As Double</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.double">double</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value to convert in pixels.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">fromDpi</span></td>
      <td><p>The source dpi.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Document.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">to</span></td>
      <td><p>The target unit of measurement.</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.double">double</a></td>
      <td><p><code class="paramref">value</code> converted to <code class="paramref">to</code> units.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Document_Unit_Convert_" data-uid="C1.Document.Unit.Convert*"></a>
<h4 id="C1_Document_Unit_Convert_System_Double_C1_Document_UnitTypeEnum_System_Double_" data-uid="C1.Document.Unit.Convert(System.Double,C1.Document.UnitTypeEnum,System.Double)">Convert(double, UnitTypeEnum, double)</h4>
<div class="markdown level1 summary"><p>Converts a value from one unit of measurement to pixel.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static double Convert(double value, UnitTypeEnum from, double toDpi)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Convert(value As Double, from As UnitTypeEnum, toDpi As Double) As Double</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.double">double</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value to convert in <code class="paramref">from</code> units.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Document.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">from</span></td>
      <td><p>The source unit of measurement.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></td>
      <td><span class="parametername">toDpi</span></td>
      <td><p>The target dpi.</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.double">double</a></td>
      <td><p><code class="paramref">value</code>The converted to pixels with specified dpi.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Document_Unit_Convert_" data-uid="C1.Document.Unit.Convert*"></a>
<h4 id="C1_Document_Unit_Convert_System_Double_C1_Document_UnitTypeEnum_C1_Document_UnitTypeEnum_" data-uid="C1.Document.Unit.Convert(System.Double,C1.Document.UnitTypeEnum,C1.Document.UnitTypeEnum)">Convert(double, UnitTypeEnum, UnitTypeEnum)</h4>
<div class="markdown level1 summary"><p>Converts a value from one unit of measurement to another.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static double Convert(double value, UnitTypeEnum from, UnitTypeEnum to)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Convert(value As Double, from As UnitTypeEnum, [to] As UnitTypeEnum) As Double</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.double">double</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value to convert.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Document.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">from</span></td>
      <td><p>The source unit of measurement.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Document.UnitTypeEnum.html">UnitTypeEnum</a></td>
      <td><span class="parametername">to</span></td>
      <td><p>The target unit of measurement.</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.double">double</a></td>
      <td><p><code class="paramref">value</code> converted to <code class="paramref">to</code> units.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
