Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

HtmlResourcePipeline

OfficeIMO.Html

Namespace
OfficeIMO.Html
Assembly
OfficeIMO.Html
Source revision
be6c300e4ab1 with working tree changes
Modifiers
static

Shared resource discovery and policy planning for OfficeIMO HTML workflows.

Inheritance

  • object
  • HtmlResourcePipeline

Methods

BuildManifest 2 overloads
public static HtmlResourceManifest BuildManifest(string html, HtmlResourcePipelineOptions? options = null) #

Parses raw HTML and builds a resource manifest.

Parameters

html string required
options OfficeIMO.Html.HtmlResourcePipelineOptions? = null optional
public static HtmlResourceManifest BuildManifest(HtmlDocument document, HtmlResourcePipelineOptions? options = null) #

Builds a resource manifest from a parsed document.

Parameters

document OfficeIMO.Html.Dom.HtmlDocument required
options OfficeIMO.Html.HtmlResourcePipelineOptions? = null optional
public static HtmlResourceManifest BuildStylesheetManifest(string css, Uri baseUri, HtmlResourcePipelineOptions? options = null) #

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) #

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) #

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) #

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.