# HtmlResourcePipeline

Shared resource discovery and policy planning for OfficeIMO HTML workflows.

Class 

`OfficeIMO.Html`

**Namespace**

`OfficeIMO.Html`

**Assembly**

`OfficeIMO.Html`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[HtmlResourcePipeline.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.cs#L56)

**Modifiers**

static

Shared resource discovery and policy planning for OfficeIMO HTML workflows.

## Inheritance

- object
- HtmlResourcePipeline

Filter members 

Show inherited

## Methods

BuildManifest 2 overloads

`public static HtmlResourceManifest BuildManifest(string html, HtmlResourcePipelineOptions? options = null)` [#](#method-buildmanifest-string-officeimo-html-htmlresourcepipelineoptions)

[HtmlResourcePipeline.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.cs#L56)

Parses raw HTML and builds a resource manifest.

Parameters

**html string required**

**options OfficeIMO.Html.HtmlResourcePipelineOptions? = null optional**

Returns

`HtmlResourceManifest`

`public static HtmlResourceManifest BuildManifest(HtmlDocument document, HtmlResourcePipelineOptions? options = null)` [#](#method-buildmanifest-officeimo-html-dom-htmldocument-officeimo-html-htmlresourcepipelineoptions)

[HtmlResourcePipeline.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.cs#L67)

Builds a resource manifest from a parsed document.

Parameters

**document OfficeIMO.Html.Dom.HtmlDocument required**

**options OfficeIMO.Html.HtmlResourcePipelineOptions? = null optional**

Returns

`HtmlResourceManifest`

`public static HtmlResourceManifest BuildStylesheetManifest(string css, Uri baseUri, HtmlResourcePipelineOptions? options = null)` [#](#method-buildstylesheetmanifest-string-uri-officeimo-html-htmlresourcepipelineoptions)

[HtmlResourcePipeline.ExternalStylesheets.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.ExternalStylesheets.cs#L70)

Parses an external stylesheet and builds the same policy-aware resource manifest used by the HTML renderer for imports, fonts, and images.

Parameters

**css string required**

Stylesheet source text.

**baseUri System.Uri required**

Absolute URI used to resolve relative stylesheet references.

**options OfficeIMO.Html.HtmlResourcePipelineOptions? = null optional**

Optional resource policy and media-context settings.

Returns

`HtmlResourceManifest` A manifest containing applicable imports and referenced font and image resources.

RewriteCssResourceUrls 2 overloads

`public static string RewriteCssResourceUrls(string css, Func<string, HtmlResourceKind, string> rewrite)` [#](#method-rewritecssresourceurls-string-func-system-string-officeimo-html-htmlresourcekind-system-string)

[HtmlResourcePipeline.Archiving.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.Archiving.cs#L30)

Rewrites stylesheet imports, URL functions and image-set strings without discarding media, supports or layer conditions.

Parameters

**css string required**

Stylesheet or inline declaration source.

**rewrite System.Func<string, OfficeIMO.Html.HtmlResourceKind, string> required**

Maps a decoded source URI and its resource kind to a replacement URI.

Returns

`string` CSS with changed resource carriers rewritten; source outside those carriers is retained.

`public static string RewriteCssResourceUrls(string css, Func<string, HtmlResourceKind, string> rewrite, bool includeFragmentReferences)` [#](#method-rewritecssresourceurls-string-func-system-string-officeimo-html-htmlresourcekind-system-string-boolean)

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

Rewrites CSS resource URLs, optionally including local fragment references when relocating document content.

Parameters

**css string required**

**rewrite System.Func<string, OfficeIMO.Html.HtmlResourceKind, string> required**

**includeFragmentReferences bool required**

Returns

`string`

`public static bool TryDecodeStylesheet(byte[] bytes, string? contentType, out string css, IHtmlEncodingProvider? encodingProvider = null)` [#](#method-trydecodestylesheet-byte-string-string-officeimo-html-dom-ihtmlencodingprovider)

[HtmlResourcePipeline.ExternalStylesheets.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Resources/HtmlResourcePipeline.ExternalStylesheets.cs#L56)

Attempts to decode stylesheet bytes using CSS encoding precedence: byte-order mark, transport content-type charset, @charset, then strict UTF-8.

Parameters

**bytes byte[] required**

Encoded stylesheet bytes.

**contentType string? required**

Optional transport content type containing a charset.

**css string required**

Decoded stylesheet text when successful.

**encodingProvider OfficeIMO.Html.Dom.IHtmlEncodingProvider? = null optional**

Optional web charset provider for this decoding operation.

Returns

`bool` true when the stylesheet encoding is supported and valid.

## Inherited Methods

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

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

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

Inherited from object

Returns

`int`

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

Inherited from object

Returns

`Type`

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

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:0F0C5B415CFBCF428978C87FE895F1A01DE1459CD7EFA25DCC6EB9B7B8DD4C7C -->
