# GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml*">DrawHtml Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_GrapeCity_Documents_Imaging_GcBitmapGraphics_GrapeCity_Documents_Html_GcHtmlBrowser_System_String_System_Single_System_Single_GrapeCity_Documents_Drawing_HtmlToImageFormat_System_Drawing_SizeF__System_Boolean_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml(GrapeCity.Documents.Imaging.GcBitmapGraphics,GrapeCity.Documents.Html.GcHtmlBrowser,System.String,System.Single,System.Single,GrapeCity.Documents.Drawing.HtmlToImageFormat,System.Drawing.SizeF@,System.Boolean)">DrawHtml(GcBitmapGraphics, GcHtmlBrowser, string, float, float, HtmlToImageFormat, out SizeF, bool)</h4>
<div class="markdown level1 summary"><p>Draws an HTML string on this <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> at a specified position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool DrawHtml(this GcBitmapGraphics graphics, GcHtmlBrowser browser, string html, float x, float y, HtmlToImageFormat format, out SizeF size, bool loadLazyImages = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function DrawHtml(graphics As GcBitmapGraphics, browser As GcHtmlBrowser, html As String, x As Single, y As Single, format As HtmlToImageFormat, ByRef size As SizeF, Optional loadLazyImages As Boolean = False) 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="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>The target <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Html.GcHtmlBrowser.html">GcHtmlBrowser</a></td>
      <td><span class="parametername">browser</span></td>
      <td><p>An instance of <a class="xref" href="GrapeCity.Documents.Html.GcHtmlBrowser.html">GcHtmlBrowser</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">html</span></td>
      <td><p>The HTML string to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The x-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.HtmlToImageFormat.html">HtmlToImageFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p>The formatting attributes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>OUT: the size of the rendered HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">loadLazyImages</span></td>
      <td><p>Whether to scroll the page down to the end to force pending images to load.</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>True if the drawn block is not empty, false otherwise.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_GrapeCity_Documents_Imaging_GcBitmapGraphics_System_String_System_Single_System_Single_GrapeCity_Documents_Drawing_HtmlToImageFormat_System_Drawing_SizeF__System_Int32_System_String_System_String_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml(GrapeCity.Documents.Imaging.GcBitmapGraphics,System.String,System.Single,System.Single,GrapeCity.Documents.Drawing.HtmlToImageFormat,System.Drawing.SizeF@,System.Int32,System.String,System.String)">DrawHtml(GcBitmapGraphics, string, float, float, HtmlToImageFormat, out SizeF, int, string, string)</h4>
<div class="markdown level1 summary"><p>Draws an HTML string on this <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> at a specified position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;Use the DrawHtml method override accepting GcHtmlBrowser as a parameter instead.&quot;)]
public static bool DrawHtml(this GcBitmapGraphics graphics, string html, float x, float y, HtmlToImageFormat format, out SizeF size, int virtualTimeBudget = 0, string authServerWhitelist = null, string proxyServer = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Obsolete(&quot;Use the DrawHtml method override accepting GcHtmlBrowser as a parameter instead.&quot;)&gt;
Public Shared Function DrawHtml(graphics As GcBitmapGraphics, html As String, x As Single, y As Single, format As HtmlToImageFormat, ByRef size As SizeF, Optional virtualTimeBudget As Integer = 0, Optional authServerWhitelist As String = Nothing, Optional proxyServer As String = Nothing) 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="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>The target <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">html</span></td>
      <td><p>The HTML string to draw.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The x-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.HtmlToImageFormat.html">HtmlToImageFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p>The formatting attributes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>OUT: the size of the rendered HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">virtualTimeBudget</span></td>
      <td><p>The number of milliseconds to wait before deeming the page to be ready.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">authServerWhitelist</span></td>
      <td><p>A whitelist for Negotiate Auth servers, such as &quot;*example.com&quot;.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">proxyServer</span></td>
      <td><p>A proxy server, such as &quot;https://proxy-ip:proxy-port&quot;.</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>True if the drawn block is not empty, false otherwise.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_GrapeCity_Documents_Imaging_GcBitmapGraphics_GrapeCity_Documents_Html_GcHtmlBrowser_System_Uri_System_Single_System_Single_GrapeCity_Documents_Drawing_HtmlToImageFormat_System_Drawing_SizeF__System_Boolean_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml(GrapeCity.Documents.Imaging.GcBitmapGraphics,GrapeCity.Documents.Html.GcHtmlBrowser,System.Uri,System.Single,System.Single,GrapeCity.Documents.Drawing.HtmlToImageFormat,System.Drawing.SizeF@,System.Boolean)">DrawHtml(GcBitmapGraphics, GcHtmlBrowser, Uri, float, float, HtmlToImageFormat, out SizeF, bool)</h4>
<div class="markdown level1 summary"><p>Draws an HTML page provided by an URI on this <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> at a specified position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static bool DrawHtml(this GcBitmapGraphics graphics, GcHtmlBrowser browser, Uri htmlUri, float x, float y, HtmlToImageFormat format, out SizeF size, bool loadLazyImages = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function DrawHtml(graphics As GcBitmapGraphics, browser As GcHtmlBrowser, htmlUri As Uri, x As Single, y As Single, format As HtmlToImageFormat, ByRef size As SizeF, Optional loadLazyImages As Boolean = False) 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="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>The target <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Html.GcHtmlBrowser.html">GcHtmlBrowser</a></td>
      <td><span class="parametername">browser</span></td>
      <td><p>An instance of <a class="xref" href="GrapeCity.Documents.Html.GcHtmlBrowser.html">GcHtmlBrowser</a> object.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Uri</span></td>
      <td><span class="parametername">htmlUri</span></td>
      <td><p>The URI specifying the source HTML 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">x</span></td>
      <td><p>The x-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.HtmlToImageFormat.html">HtmlToImageFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p>The formatting attributes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>OUT: the size of the rendered HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">loadLazyImages</span></td>
      <td><p>Whether to scroll the page down to the end to force pending images to load.</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>True if the drawn block is not empty, false otherwise.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml*"></a>
<h4 id="GrapeCity_Documents_Drawing_GcBitmapGraphicsExt_DrawHtml_GrapeCity_Documents_Imaging_GcBitmapGraphics_System_Uri_System_Single_System_Single_GrapeCity_Documents_Drawing_HtmlToImageFormat_System_Drawing_SizeF__System_Int32_System_String_System_String_" data-uid="GrapeCity.Documents.Drawing.GcBitmapGraphicsExt.DrawHtml(GrapeCity.Documents.Imaging.GcBitmapGraphics,System.Uri,System.Single,System.Single,GrapeCity.Documents.Drawing.HtmlToImageFormat,System.Drawing.SizeF@,System.Int32,System.String,System.String)">DrawHtml(GcBitmapGraphics, Uri, float, float, HtmlToImageFormat, out SizeF, int, string, string)</h4>
<div class="markdown level1 summary"><p>Draws an HTML page provided by an URI on this <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> at a specified position.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;Use the DrawHtml method override accepting GcHtmlBrowser as a parameter instead.&quot;)]
public static bool DrawHtml(this GcBitmapGraphics graphics, Uri htmlUri, float x, float y, HtmlToImageFormat format, out SizeF size, int virtualTimeBudget = 0, string authServerWhitelist = null, string proxyServer = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Obsolete(&quot;Use the DrawHtml method override accepting GcHtmlBrowser as a parameter instead.&quot;)&gt;
Public Shared Function DrawHtml(graphics As GcBitmapGraphics, htmlUri As Uri, x As Single, y As Single, format As HtmlToImageFormat, ByRef size As SizeF, Optional virtualTimeBudget As Integer = 0, Optional authServerWhitelist As String = Nothing, Optional proxyServer As String = Nothing) 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="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p>The target <a class="xref" href="../DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html">GcBitmapGraphics</a> object.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">Uri</span></td>
      <td><span class="parametername">htmlUri</span></td>
      <td><p>The URI specifying the source HTML 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">x</span></td>
      <td><p>The x-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>The y-coordinate at which to draw the HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Drawing.HtmlToImageFormat.html">HtmlToImageFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p>The formatting attributes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.sizef">SizeF</a></td>
      <td><span class="parametername">size</span></td>
      <td><p>OUT: the size of the rendered HTML block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">virtualTimeBudget</span></td>
      <td><p>The number of milliseconds to wait before deeming the page to be ready.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">authServerWhitelist</span></td>
      <td><p>A whitelist for Negotiate Auth servers, such as &quot;*example.com&quot;.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">proxyServer</span></td>
      <td><p>A proxy server, such as &quot;https://proxy-ip:proxy-port&quot;.</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>True if the drawn block is not empty, false otherwise.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
