HtmlRenderOptions
OfficeIMO.Html
Shared layout and safety options used by HTML image and PDF rendering.
Inheritance
- OfficeImageExportOptions
- HtmlRenderOptions
Usage
Explore 12 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 4
Accepted by parameters 8
- Method HtmlConversionDocument.CreateVisibleContentDocumentResultAsync
- Method HtmlEditableLayoutProjector.Project
- Method HtmlRenderEngine.Render
- Method HtmlRenderEngine.RenderAsync
- Method HtmlRenderRequest.Create
- Method HtmlRenderRequest.WithOptions
- Method HtmlResourceSession.Resolve
- Method HtmlResourceSession.ResolveAsync
Constructors
public HtmlRenderOptions() #Creates the default paged print configuration. Select HtmlRenderMode.Continuous for an unpaginated screenshot.
Methods
public virtual HtmlRenderOptions Clone() #Creates an independent options snapshot.
Returns
HtmlRenderOptionspublic HtmlRenderOptions UseBrowserUserAgentStyles() #Selects the bounded browser user-agent defaults and a generic serif fallback. Authored CSS continues to override these defaults.
Returns
HtmlRenderOptionspublic HtmlRenderOptions UseTextHyphenationLexicon(OfficeTextHyphenationLexicon? lexicon) #Uses or clears a shared immutable hyphenation lexicon for CSS hyphens:auto.
Parameters
- lexicon OfficeIMO.Drawing.OfficeTextHyphenationLexicon?
Returns
HtmlRenderOptionsInherited Methods
public OfficeImageExportResult EnsureAccepted(OfficeImageExportResult result) #Parameters
- result OfficeImageExportResult
Returns
OfficeImageExportResultpublic double GetEffectiveScale(double logicalWidth, double logicalHeight) #Parameters
- logicalWidth double
- logicalHeight double
Returns
doubleProperties
public int PageIndex { get; set; } #Zero-based page used by single-image conversion and saving operations.
public IReadOnlyList<int>? PageSelection { get; set; } #Caller-ordered one-based page numbers within the retained surfaces for batch image export. Null exports all retained surfaces. Single-image operations use their selected page instead. This does not change HTML layout, PDF output, or the request's page set.
public HtmlRenderMode Mode { get; set; } #Layout mode. Defaults to paged print output; select Continuous for an unpaginated screenshot.
public HtmlRenderFidelityPolicy FidelityPolicy { get; set; } #Determines whether diagnosed approximations, omissions, or failures may be returned. Strict rendering rejects every warning or error after collecting the complete diagnostic report.
public bool? ProjectSerializedShadowRoots { get; set; } #Projects Chromium MHTML template shadowmode snapshots into static render content. Null uses the source-format default (enabled for MHTML, disabled for ordinary HTML). This is a diagnosed approximation of shadow DOM composition, not a live shadow tree.
public double ViewportWidth { get; set; } #Viewport width for continuous rendering and print-fit media selection, in CSS pixels.
public double? ViewportHeight { get; set; } #Optional minimum continuous-surface height, in CSS pixels.
public OfficePageSize PageSize { get; set; } #Physical page size used by paged rendering.
public bool HonorCssPageRules { get; set; } #When true, generic print @page size and margin declarations override the paged defaults.
public HtmlRenderMargins Margins { get; set; } #Page or continuous-surface margins measured in CSS pixels.
public string DefaultFontFamily { get; set; } #Default font family used when CSS does not select one.
public bool AllowSystemFontFallback { get; set; } #Resolves the configured default family and installed faces in system-UI or mathematical fallback lists through the owned font loader. Disable this for a portable render that uses only supplied/document fonts.
public double DefaultFontSize { get; set; } #Default CSS font size in pixels.
public double DefaultLineHeight { get; set; } #Fallback line-height multiplier when selected font metrics are unavailable. Assign explicitly to override missing or normal CSS line height with this multiplier. Authored numeric, length and percentage line heights retain precedence.
public HtmlRenderUserAgentStyleMode UserAgentStyles { get; set; } #Bounded user-agent style defaults applied before authored CSS. The document profile preserves the existing OfficeIMO layout contract.
public OfficeTextHyphenationCallback? TextHyphenationCallback { get; set; } #Optional caller-owned dictionary or algorithm that overrides embedded language patterns for CSS hyphens:auto.
public HtmlRenderMediaFeatures MediaFeatures { get; set; } #Deterministic device and user-preference values exposed to CSS media queries.
public IList<string> AdditionalStylesheets { get; } #Caller-provided author stylesheets appended after document stylesheets. Each entry participates in the normal bounded cascade and resource policy.
public Uri? BaseUri { get; set; } #Optional base URI used to resolve links and resource references.
public HtmlUrlPolicy UrlPolicy { get; set; } #URL policy applied before links or resources enter the rendered result.
public HtmlUrlPolicy? ResourceUrlPolicy { get; set; } #Optional separate policy for images, stylesheets, fonts, and other render resources. When omitted, HtmlRenderOptions.UrlPolicy is used. This lets package or application resolvers authorize a resource origin without authorizing the same scheme for emitted hyperlinks.
public HtmlRenderResourceResolver? ResourceResolver { get; set; } #Optional application-supplied asynchronous resolver for policy-approved external resources.
public TimeSpan ResourceTimeout { get; set; } #Deadline after which one resolver invocation's cancellation token is cancelled.
public int MaxConcurrentResourceLoads { get; set; } #Maximum asynchronous resolver invocations allowed to run concurrently.
public long MaxResourceBytes { get; set; } #Maximum bytes accepted from one resolved resource.
public long MaxTotalResourceBytes { get; set; } #Maximum total bytes accepted from external resources in one render operation.
public int MaxResourceCount { get; set; } #Maximum number of external resources accepted in one render operation.
public int MaxResourceRequests { get; set; } #Maximum resolver invocations attempted in one render operation, including misses and failures.
public int MaxStylesheetImportDepth { get; set; } #Maximum recursive @import depth accepted for external stylesheets.
public int MaxSurfaceWidth { get; set; } #Maximum width of any generated image surface in output pixels.
public int MaxSurfaceHeight { get; set; } #Maximum height of any generated image surface in output pixels.
public int MaxPageCount { get; set; } #Maximum page count accepted from one paged render operation.
public int MaxProjectedVisuals { get; set; } #Maximum visual nodes materialized while slicing or composing retained surfaces.
public int MaxLayoutDepth { get; set; } #Maximum element nesting depth processed by the layout engine.
public int MaxInputCharacters { get; set; } #Maximum UTF-16 characters accepted in the source HTML string. The default leaves enough room for the default total resource budget when resources are embedded as base64 data URIs.
public int MaxHtmlNodes { get; set; } #Maximum DOM nodes accepted after parsing and before style or layout work begins.
public int MaxBackgroundImageTiles { get; set; } #Maximum total repeated background-image tiles accepted in one render operation.
public int MaxBackgroundImageLayers { get; set; } #Maximum background-image layers accepted on one element.
public int MaxBoxShadowLayers { get; set; } #Maximum CSS box-shadow layers accepted on one element.
public int MaxTextShadowLayers { get; set; } #Maximum CSS text-shadow layers retained on one element, from 1 to 64.
public int MaxLeaderCharacters { get; set; } #Maximum characters materialized for a generated CSS leader.
public int MaxSvgForeignObjectDepth { get; set; } #Maximum nested SVG foreignObject HTML render depth.
public int MaxSvgForeignObjectHtmlNodes { get; set; } #Maximum DOM nodes accepted by one inline SVG foreignObject HTML viewport.
public int MaxFrameDepth { get; set; } #Maximum nested iframe srcdoc viewports rendered into one output.
public int MaxGradientStops { get; set; } #Maximum color stops accepted in one CSS gradient.
public int ConicGradientQualitySegments { get; set; } #Uniform vector quality segments used when expanding one conic gradient.
public int MaxGridTracks { get; set; } #Maximum explicit or implicit tracks accepted on either grid axis.
public int MaxColumnCount { get; set; } #Maximum generated columns accepted in one multi-column formatting context.
public int MaxTableRows { get; set; } #Maximum rows accepted in one rendered HTML table.
public int MaxTableColumns { get; set; } #Maximum columns accepted in one rendered HTML table.
public int MaxCollapsedTableBorderSegments { get; set; } #Maximum candidate edge segments resolved for one collapsed-border table.
public int MaxLayoutOperations { get; set; } #Maximum element layout operations allowed in one render.
public int MaxRunningStringCharacters { get; set; } #Maximum normalized UTF-16 characters retained in one CSS running-string value.
public HtmlCssMediaContext MediaContext { get; } #Gets the CSS media context selected by an explicit render request, or by the legacy continuous/screen and paged/print mapping when no request is active.
public double PageWidth { get; } #Gets the paged surface width in CSS pixels.
public double PageHeight { get; } #Gets the paged surface height in CSS pixels.
Inherited Properties
public OfficeImageExportFormat Format { get; set; } #public OfficePageSelector? PageSelector { get; set; } #public OfficeImageExportFileConflictPolicy FileConflictPolicy { get; set; } #public bool FailOnLoss { get; set; } #public OfficeChartRenderOptions ChartRendering { get; set; } #public double Scale { get; set; } #public int? MaximumOutputWidth { get; set; } #public int? MaximumOutputHeight { get; set; } #public OfficeColor BackgroundColor { get; set; } #public OfficeRasterEncodingOptions RasterEncoding { get; set; } #public bool SvgTextAsPaths { get; set; } #public long MaximumRasterPixels { get; set; } #public OfficeRasterOverflowBehavior RasterOverflowBehavior { get; set; } #public IOfficeRasterImageCodec? ImageCodec { get; set; } #public double? TargetDpi { get; set; } #public OfficeFontFaceCollection Fonts { get; set; } #public IOfficeTextShapingProvider? TextShapingProvider { get; set; } #public string? TextShapingLanguage { get; set; } #public OfficeImageExportPolicy Policy { get; set; } #public IProgress<OfficeImageExportProgress>? Progress { get; set; } #public int MaximumOutputCount { get; set; } #public long MaximumTotalRasterPixels { get; set; } #public long MaximumTotalEncodedBytes { get; set; } #public TimeSpan RenderTimeout { get; set; } #public int MaximumDegreeOfParallelism { get; set; } #public virtual double LogicalUnitsPerInch { get; } #Fields
public const double CssPixelsPerInch #CSS reference pixel density used for physical page conversion.
96