# HtmlRenderMargins

Immutable HTML render margins measured in CSS pixels.

Struct 

`OfficeIMO.Html`

**Namespace**

`OfficeIMO.Html`

**Assembly**

`OfficeIMO.Html`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[HtmlRenderMargins.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L9)

**Base**

`ValueType`

**Implements**

`IEquatable<HtmlRenderMargins>`

**Modifiers**

sealed

Immutable HTML render margins measured in CSS pixels.

## Inheritance

- ValueType
- HtmlRenderMargins

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Convert HTML to PDF](/docs/html/html-to-pdf/) Guide
  
  Convert HTML pages and reports to PDF in .NET without a browser, with page size, margins, extra CSS, headers and footers, and local images and fonts.
- [Render HTML to Images and Convert to Word, Markdown and RTF](/docs/html/render-and-convert/) Guide
  
  Render HTML to PNG, JPEG, WebP, TIFF or SVG screenshots and page images, and convert HTML into editable Word, Markdown or RTF documents.
- [Personalized course certificate](/showcase/html-course-certificate/) Sample
  
  Render a personalized HTML workshop certificate to PDF with an inline SVG mark and print styling. Includes the HTML document and runnable C# source.
- [Service review with explicit target misses](/showcase/html-service-level-report/) Sample
  
  Generate an HTML service review that compares actual values with targets and keeps missed thresholds visible in the PDF.

## Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 3

- Method [HtmlRenderMargins.All](/api/html/officeimo-html-htmlrendermargins/#method-all-double)
- Property [HtmlRenderOptions.Margins](/api/html/officeimo-html-htmlrenderoptions/#property-margins)
- Property [HtmlRenderPage.Margins](/api/html/officeimo-html-htmlrenderpage/#property-margins)

### Accepted by parameters 5

- Method [HtmlRenderMargins.Equals](/api/html/officeimo-html-htmlrendermargins/#method-equals-officeimo-html-htmlrendermargins) parameter `other`
- Method [HtmlRenderMargins.op_Equality](/api/html/officeimo-html-htmlrendermargins/#method-op-equality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins) parameter `left`
- Method [HtmlRenderMargins.op_Equality](/api/html/officeimo-html-htmlrendermargins/#method-op-equality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins) parameter `right`
- Method [HtmlRenderMargins.op_Inequality](/api/html/officeimo-html-htmlrendermargins/#method-op-inequality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins) parameter `left`
- Method [HtmlRenderMargins.op_Inequality](/api/html/officeimo-html-htmlrendermargins/#method-op-inequality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins) parameter `right`

Filter members 

Show inherited

## Constructors

`public HtmlRenderMargins(double left, double top, double right, double bottom)` [#](#constructor-ctor-double-double-double-double)

[HtmlRenderMargins.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L9)

Creates page or continuous-surface margins.

Parameters

**left double required**

**top double required**

**right double required**

**bottom double required**

## Methods

`public static HtmlRenderMargins All(double value)` [#](#method-all-double)

[HtmlRenderMargins.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L43)

Creates equal margins on every side.

Parameters

**value double required**

Returns

`HtmlRenderMargins`

Equals 2 overloads

`public bool Equals(HtmlRenderMargins other)` [#](#method-equals-officeimo-html-htmlrendermargins)

[HtmlRenderMargins.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L50)

Indicates whether the current object is equal to another object of the same type.

Parameters

**other OfficeIMO.Html.HtmlRenderMargins required**

An object to compare with this object.

Returns

`bool` true if the current object is equal to the other parameter; otherwise, false.

`public override bool Equals(object? obj)` [#](#method-equals-object)

[HtmlRenderMargins.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L53)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public override int GetHashCode()` [#](#method-gethashcode)

[HtmlRenderMargins.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L58)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public static bool op_Equality(HtmlRenderMargins left, HtmlRenderMargins right)` [#](#method-op-equality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins)

[HtmlRenderMargins.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L68)

Equality operator.

Parameters

**left OfficeIMO.Html.HtmlRenderMargins required**

**right OfficeIMO.Html.HtmlRenderMargins required**

Returns

`bool`

`public static bool op_Inequality(HtmlRenderMargins left, HtmlRenderMargins right)` [#](#method-op-inequality-officeimo-html-htmlrendermargins-officeimo-html-htmlrendermargins)

[HtmlRenderMargins.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L71)

Inequality operator.

Parameters

**left OfficeIMO.Html.HtmlRenderMargins required**

**right OfficeIMO.Html.HtmlRenderMargins required**

Returns

`bool`

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public override string? ToString()` [#](#method-tostring)

Inherited from ValueType

Returns

`string?`

## Properties

`public double Left { get; }` [#](#property-left)

[HtmlRenderMargins.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L31)

Left margin in CSS pixels.

`public double Top { get; }` [#](#property-top)

[HtmlRenderMargins.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L34)

Top margin in CSS pixels.

`public double Right { get; }` [#](#property-right)

[HtmlRenderMargins.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L37)

Right margin in CSS pixels.

`public double Bottom { get; }` [#](#property-bottom)

[HtmlRenderMargins.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Rendering/HtmlRenderMargins.cs#L40)

Bottom margin in CSS pixels.

<!-- PowerForge markdown artifact sha256:8339D1108399CAE5C75EC4BC3E99CACCAF3BE77145A776DF31D3840E438BC716 -->
