HtmlRendererUtils

TheArtOfDev.HtmlRenderer.Core

General utilities.

Properties

GlobalHttp : HttpClient

Global http client to use for all http requests in the library.

Methods

EnsureGetHttp() : HttpClient

Ensure the global http client is created and return it.

Layout(RGraphics, HtmlContainerInt, RSize, RSize, RSize, bool, bool) : RSize

Perform the layout of the html container by given size restrictions returning the final size. The layout can be effected by the HTML content in the if or is set to true. Handle minimum and maximum size restrictions. Handle auto size and auto size for height only. if is true is ignored.

g
the graphics used for layout
htmlContainer
the html container to layout
size
the current size
minSize
the min size restriction - can be empty for no restriction
maxSize
the max size restriction - can be empty for no restriction
autoSize
if to modify the size (width and height) by html content layout
autoSizeHeightOnly
if to modify the height by html content layout
MeasureHtmlByRestrictions(RGraphics, HtmlContainerInt, RSize, RSize) : RSize

Measure the size of the html by performing layout under the given restrictions.

g
the graphics to use
htmlContainer
the html to calculate the layout for
minSize
the minimal size of the rendered html (zero - not limit the width/height)
maxSize
the maximum size of the rendered html, if not zero and html cannot be layout within the limit it will be clipped (zero - not limit the width/height)

Returns: return: the size of the html to be rendered within the min/max limits