[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.HtmlToImageFormat

Class HtmlToImageFormat

Namespace
GrapeCity.Documents.Drawing
Assembly
GcDocs.Html.dll

Represents the formatting attributes for rendering HTML to GcBitmapGraphics.

public class HtmlToImageFormat
Inheritance
object
HtmlToImageFormat
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

HtmlToImageFormat(bool, bool)

Initializes a new instance of HtmlToImageFormat.

If fullPage is true, the resulting image size will be calculated automatically to include all page content. The minimal size will be determined by WindowSize.

If fullPage is false, the maximum resulting image size will be determined by MaxWindowWidth and MaxWindowHeight (possibly clipping some content).

public HtmlToImageFormat(bool fullPage, bool trimMargins = true)

Parameters

fullPage bool

Specifies whether to render the whole page.

trimMargins bool

Specifies whether to trim image margins.

See Also

Properties

Clip

If set, captures the specified rectangular region only (in pixels).

Note that this property is ignored if FullPage is true.

public RectangleF? Clip { get; set; }

Property Value

System.Drawing.RectangleF?

DefaultBackgroundColor

Gets or sets the background color to be used if the HTML page doesn't specify one. Defaults to White color.

public Color DefaultBackgroundColor { get; set; }

Property Value

System.Drawing.Color

FullPage

Gets or sets a value indicating whether the full HTML page should be captured.

Note that if this property is true, MaxWindowWidth, MaxWindowHeight and Clip are ignored.

Conversely, if this property is false, WindowSize is ignored.

public bool FullPage { get; set; }

Property Value

bool
See Also

MaxBottomMargin

Gets or sets the maximum height of the bottom margin, in pixels. Negative value prevents trimming the bottom margin. Defaults to 0 (no bottom margin).

public int MaxBottomMargin { get; set; }

Property Value

int

MaxLeftMargin

Gets or sets the maximum width of the left margin, in pixels. Negative value prevents trimming the left margin. Defaults to 0 (no left margin).

public int MaxLeftMargin { get; set; }

Property Value

int

MaxRightMargin

Gets or sets the maximum width of the right margin, in pixels. Negative value prevents trimming the right margin. Defaults to 0 (no right margin).

public int MaxRightMargin { get; set; }

Property Value

int

MaxTopMargin

Gets or sets the maximum height of the top margin, in pixels. Negative value prevents trimming the top margin. Defaults to 0 (no top margin).

public int MaxTopMargin { get; set; }

Property Value

int

MaxWindowHeight

Gets or sets the maximum window height, in pixels. Defaults to 1600.

Note that this property is ignored if FullPage is true.

public int MaxWindowHeight { get; set; }

Property Value

int

MaxWindowWidth

Gets or sets the maximum window width, in pixels. Defaults to 1200.

Note that this property is ignored if FullPage is true.

public int MaxWindowWidth { get; set; }

Property Value

int

Scale

Gets or sets the scale factor. Defaults to 1.0.

public float Scale { get; set; }

Property Value

float

WindowSize

Gets or sets the minimal window size before trimming margins, in pixels. Defaults to 800 x 600.

Note that this property is ignored if FullPage is false.

public Size WindowSize { get; set; }

Property Value

System.Drawing.Size