HtmlConversionDocument
OfficeIMO.Html
Canonical OfficeIMO HTML conversion document shared by target adapters.
Inheritance
- object
- HtmlConversionDocument
Usage
Explore 17 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 9
- Method HtmlConversionDocument.Edit
- Method HtmlConversionDocument.FromDocument
- Method HtmlConversionDocument.Load
- Method HtmlConversionDocument.LoadAsync
- Method HtmlConversionDocument.Parse
- Method HtmlConversionDocument.WithTheme
- Property HtmlSiteBundle.HtmlDocument
- Method HtmlVisibleContentResult.RequireValue
- Property HtmlVisibleContentResult.Value
Accepted by parameters 8
- Method HtmlComputedStyleEngine.Compute
- Method HtmlEditableLayoutProjector.Project
- Method HtmlRenderEngine.Execute
- Method HtmlRenderEngine.ExecuteAsync
- Method HtmlRenderEngine.Render
- Method HtmlRenderEngine.RenderAsync
- Method HtmlRoundTripScorer.Compare
- Method HtmlRoundTripScorer.Compare
Methods
public HtmlConversionPreflight AnalyzeFor(HtmlConversionTarget target) #Predicts supported, approximated, and omitted source features for a target before artifact creation. Results are cached per prepared document and target.
Parameters
- target OfficeIMO.Html.HtmlConversionTarget
Returns
HtmlConversionPreflightpublic HtmlDocument CreateDocumentForConversion() #Creates an independent policy-normalized DOM for the conversion profile's default media context.
Returns
HtmlDocumentpublic HtmlDocument CreateDocumentForConversion(CancellationToken cancellationToken) #Creates an independent policy-normalized DOM with cooperative cancellation.
Parameters
- cancellationToken System.Threading.CancellationToken
Returns
HtmlDocumentpublic HtmlDocument CreateDocumentForConversion(HtmlCssMediaContext mediaContext) #Creates a policy-normalized DOM filtered for a target media context without reparsing source HTML or mutating shared state.
Parameters
- mediaContext OfficeIMO.Html.HtmlCssMediaContext
- Screen or print media context selected by the target adapter.
Returns
HtmlDocument An independent DOM clone that the target adapter may safely mutate.public HtmlDocument CreateDocumentForConversion(HtmlCssMediaContext mediaContext, CancellationToken cancellationToken) #Creates an independent policy-normalized DOM for the selected media context with cooperative cancellation.
Parameters
- mediaContext OfficeIMO.Html.HtmlCssMediaContext
- Screen or print media context selected by the target adapter.
- cancellationToken System.Threading.CancellationToken
- Cancels normalization, cloning, media filtering and owned-DOM projection.
Returns
HtmlDocument An independent DOM clone that the target adapter may safely mutate.public Task<HtmlVisibleContentResult> CreateVisibleContentDocumentResultAsync(HtmlRenderOptions? options = null, CancellationToken cancellationToken = default) #Creates an independent editable source without elements hidden by computed display: none, zero opacity, or a closed details element in the requested screen or print environment. The returned source keeps its original stylesheet links and bounded import contract. A supported computed image maximum width is retained as an inline hint so editable targets do not expand a captured image to its unconstrained intrinsic size.
Parameters
- options OfficeIMO.Html.HtmlRenderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<HtmlVisibleContentResult>public HtmlConversionDocument Edit(Action<HtmlDocument> edit) #Edits an independent source snapshot and retains this conversion's trust, resource and fidelity options.
Parameters
- edit System.Action<OfficeIMO.Html.Dom.HtmlDocument>
Returns
HtmlConversionDocumentpublic string ExportSourceHtml() #Serializes the source document with its effective absolute base URI so relative references still resolve against the original location when the HTML is saved elsewhere.
Returns
stringpublic static HtmlConversionDocument FromDocument(HtmlDocument document, HtmlConversionDocumentOptions? options = null) #Creates a conversion snapshot from an owned tree without reparsing its serialized markup.
Parameters
- document OfficeIMO.Html.Dom.HtmlDocument
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
Returns
HtmlConversionDocumentpublic static HtmlConversionDocument FromDocument(HtmlDocument document, HtmlConversionDocumentOptions? options, CancellationToken cancellationToken) #Captures an owned tree with cooperative cancellation during validation, cloning, projection and serialization.
Parameters
- document OfficeIMO.Html.Dom.HtmlDocument
- options OfficeIMO.Html.HtmlConversionDocumentOptions?
- cancellationToken System.Threading.CancellationToken
Returns
HtmlConversionDocumentpublic static HtmlConversionDocument Load(string path, HtmlConversionDocumentOptions? options = null, Encoding? encoding = null) #Loads and parses an HTML file.
Parameters
- path string
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
- encoding System.Text.Encoding? = null
Returns
HtmlConversionDocumentpublic static HtmlConversionDocument Load(Stream stream, HtmlConversionDocumentOptions? options = null, Encoding? encoding = null) #Loads and parses HTML from a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
- encoding System.Text.Encoding? = null
Returns
HtmlConversionDocumentpublic static async Task<HtmlConversionDocument> LoadAsync(string path, HtmlConversionDocumentOptions? options = null, Encoding? encoding = null, CancellationToken cancellationToken = default) #Asynchronously loads and parses an HTML file.
Parameters
- path string
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
- encoding System.Text.Encoding? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<HtmlConversionDocument>public static async Task<HtmlConversionDocument> LoadAsync(Stream stream, HtmlConversionDocumentOptions? options = null, Encoding? encoding = null, CancellationToken cancellationToken = default) #Asynchronously loads and parses HTML from a caller-owned stream.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
- encoding System.Text.Encoding? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<HtmlConversionDocument>public static HtmlConversionDocument Parse(string html, HtmlConversionDocumentOptions? options = null) #Parses HTML and builds a shared conversion document with logical, style, resource, and normalized-output evidence.
Parameters
- html string
- options OfficeIMO.Html.HtmlConversionDocumentOptions? = null
Returns
HtmlConversionDocumentpublic static HtmlConversionDocument Parse(string html, HtmlConversionDocumentOptions? options, CancellationToken cancellationToken) #Parses inert HTML with explicit cooperative cancellation.
Parameters
- html string
- options OfficeIMO.Html.HtmlConversionDocumentOptions?
- cancellationToken System.Threading.CancellationToken
Returns
HtmlConversionDocumentpublic HtmlConversionDocument WithTheme(OfficeTheme theme) #Returns an independent document with theme defaults for unstyled content. Authored CSS and inline formatting take precedence.
Parameters
- theme OfficeIMO.OfficeTheme
Returns
HtmlConversionDocumentInherited Methods
Properties
public string SourceHtml { get; } #Original HTML supplied by the caller.
public HtmlDocument Document { get; } #Owned, immutable source DOM. Access does not normalize content, fetch resources or execute scripts.
public HtmlConversionProfileContract ProfileContract { get; } #Profile contract advertised to target adapters and galleries.
public HtmlInputTrust Trust { get; } #Caller-assigned input trust boundary used by downstream adapters.
public HtmlLogicalDocument LogicalDocument { get; } #Normalized logical structure used for semantic scoring and adapter planning.
public HtmlSemanticDocument SemanticDocument { get; } #Typed semantic structure interpreted once for generic native target adapters.
public HtmlComputedStyleSummary StyleSummary { get; } #Compact computed-style capability summary.
public HtmlResourceManifest ResourceManifest { get; } #Raw resource manifest discovered in document order.
public HtmlResourceDependencyPlan ResourcePlan { get; } #Resource dependency plan grouped for adapters, reports, and gallery manifests.
public Uri? BaseUri { get; } #Effective base URI used to resolve relative resources, including a document base element when present.
public string NormalizedHtml { get; } #Policy-aware normalized HTML, or an empty string when normalization was disabled.
public IReadOnlyList<HtmlDiagnostic> Diagnostics { get; } #Diagnostics emitted while lazily preparing shared conversion views.
public string HtmlForConversion { get; } #HTML text target adapters should use when no adapter-specific source preference is configured.