Article screenshot generation options.

Hierarchy

Properties

antiAliasingQuality?: number

defines the antialiasing quality, higher is better. (range: [0, 32], default: 32)

backgroundColor?: Color4

can be used to override the viewer backgroundColor, for transparent backgrounds a premultiplied alpha color has to be used e.g. (0, 0, 0, 0)

cameraAlpha?: number

alpha camera rotation (y-axis) in degree (default: -15)

cameraBeta?: number

beta camera rotation (x-axis) in degree (default: 20)

cameraFov?: number

camera field of view in degree (default: 30)

height: number

height of the image in pixel

hideSubArticles?: boolean

renders only the main article if true (default: false)

margin?: number

margin for the zoom (default: 0.05 (5%))

mimeType?: string

MIME-Type of the data uri (default: "image/png")

onAfterRender?: (() => void)

Type declaration

    • (): void
    • callback which will be called after the rendering

      Returns void

onBeforeRender?: (() => void)

Type declaration

    • (): void
    • callback which will be called before the rendering

      Returns void

onDrawBackground?: ((pContext: CanvasRenderingContext2D) => Promise<void>)

Type declaration

    • (pContext: CanvasRenderingContext2D): Promise<void>
    • Allows do draw a background for the generated screenshot. Only called if the current background color is transparent.

      Parameters

      • pContext: CanvasRenderingContext2D

      Returns Promise<void>

onDrawOverlay?: ((pContext: CanvasRenderingContext2D) => Promise<void>)

Type declaration

    • (pContext: CanvasRenderingContext2D): Promise<void>
    • allows do draw an overlay on the generated screenshot

      Parameters

      • pContext: CanvasRenderingContext2D

      Returns Promise<void>

orthographic?: boolean

use orthographic camera mode (default: false)

pixelScaleFactor?: number

pixel scale factor is used to scale certain elements like 2D text (default: 1.0)

renderAsync?: boolean

if true the rendering will be performed asynchronously (default: false)

ssaoQuality?: SSAOQuality

can be used to override the viewer ssaoQuality

targetCanvas?: HTMLCanvasElement

Optional target canvas. If defined the screenshot will be rendered into this canvas. Viewer.createScreenshot() will return an empty string in this case.

width: number

width of the image in pixel

Generated using TypeDoc