Copy

RenderOptions

Options applied to one HTML snapshot and PDF render.

ON_THIS_PAGE
  1. Signature
  2. Properties

Options applied to one HTML snapshot and PDF render.

Signature

export interface RenderOptions {
    page?: PageOptions;
    strict?: boolean;
    cssProfile?: CssProfile;
    mediaType?: MediaType;
    layoutContext?: LayoutContext;
    viewport?: ViewportOptions;
    unsupportedCss?: UnsupportedCssPolicy;
    fallback?: FallbackPolicy;
    canvasToSvg?: CanvasToSvg;
    canvasFallback?: CanvasFallbackPolicy;
    includeShadowDom?: boolean;
    baseUrl?: string | URL;
    resourcePolicy?: "error" | "omit";
    resourceResolver?: ResourceResolver;
    pageBreak?: PageBreakRules;
    metadata?: PdfMetadata;
    enableLinks?: boolean;
    signal?: AbortSignal;
    onProgress?: (progress: RenderProgress) => void;
}
SOURCE:193

Properties

PropertyTypeRequiredRead onlyDefaultDescription
pagePageOptionsNoNoNoneExplicit page geometry; captured @page rules are used when omitted.
strictbooleanNoNoNonePromotes unsupported snapshot CSS to errors without selecting the web layout profile. An explicit unsupportedCss policy takes precedence.
cssProfileCssProfileNoNodocumentLayout profile. Defaults to document.
mediaTypeMediaTypeNoNoscreenMedia environment used for style resolution. Defaults to screen.
layoutContextLayoutContextNoNosourceRoot layout context. source preserves the mounted browser width; page resolves an implicit root width and auto inline margins against the PDF content box. Defaults to source.
viewportViewportOptionsNoNoNoneIsolated viewport used for media queries and responsive layout.
unsupportedCssUnsupportedCssPolicyNoNoerror for strict mode and warn otherwiseUnsupported-CSS policy; defaults to error for strict mode and warn otherwise.
fallbackFallbackPolicyNoNoerrorUnsupported SVG policy. Defaults to error.
canvasToSvgCanvasToSvgNoNoNoneOptional bridge from live canvas content to validated SVG.
canvasFallbackCanvasFallbackPolicyNoNoerrorFallback when canvasToSvg returns null. Defaults to error.
includeShadowDombooleanNoNofalseFlattens open Shadow DOM into the snapshot. Defaults to false.
baseUrlstring | URLNoNothe source document URLBase URL for relative resources. Defaults to the source document URL.
resourcePolicy"error" | "omit"NoNoerrorFailed-resource policy. Defaults to error.
resourceResolverResourceResolverNoNoNoneResolver for protected, virtual, or otherwise unavailable resources.
pageBreakPageBreakRulesNoNoNoneSelector-driven page-break overrides.
metadataPdfMetadataNoNoNonePDF information dictionary fields.
enableLinksbooleanNoNoNonePreserves HTTP(S), mail, telephone, and FTP annotations unless explicitly set to false.
signalAbortSignalNoNoNoneRejects the caller at snapshot and render boundaries when aborted. An already-running synchronous WASM render cannot be preempted.
onProgress(progress: RenderProgress) => voidNoNoNoneReceives coarse phase-boundary progress, not per-page render progress.
ON_THIS_PAGE
  1. Signature
  2. Properties
html2realpdf documentationCopyright © Imggion
DOCUMENTATION_TREE