Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# `DrawDevice`

The `DrawDevice` can be used to render to a Pixmap; either by running a Page with it or by calling its methods directly.

new DrawDevice(transform, pixmap)

  Constructor method.

  Create a device for drawing into a `Pixmap`. The `Pixmap` bounds used should match the transformed page bounds, or you can adjust them to only draw a part of the page.

  Arguments:

    - transform – `[a,b,c,d,e,f]`. The transform matrix.

    - pixmap – `Pixmap`.

  Returns:

    `DrawDevice`.

  EXAMPLE

      var drawDevice = new mupdf.DrawDevice(mupdf.Matrix.identity, pixmap);