Ink: requestPresenter() method
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The requestPresenter()
method of the Ink
interface returns a Promise
that fulfills with an InkPresenter
object to handle rendering strokes.
Syntax
js
requestPresenter(param)
Parameters
param
Optional-
An
InkPresenterParam
object that contains the following property:presentationArea
Optional-
An
Element
inside which rendering of ink strokes is confined (the element's border box, to be precise). Ifparam
is not included, orpresentationArea
is set tonull
, ink rendering is confined to the containing viewport by default.
Return value
A Promise
that resolves to an InkPresenter
object instance.
Exceptions
Error
DOMException
-
An error is thrown and the operation is aborted if
presentationArea
is not a validElement
, or is not in the same document as the associatedInk
object.
Example
js
async function inkInit() {
const ink = navigator.ink;
let presenter = await ink.requestPresenter({ presentationArea: canvas });
//...
}
Specifications
Specification |
---|
Ink API # dom-ink-requestpresenter |
Browser compatibility
BCD tables only load in the browser