# Interface: PageImageBase

[Mobile Document Scanner API Reference](../index.md) / PageImageBase

# Interface: PageImageBase

Defined in: [src/results.ts:53](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L53)

The members of every page image, raster or vector.

## Extended by

- [`RasterImage`](RasterImage.md)
- [`VectorImage`](VectorImage.md)

## Properties

### height

> `readonly` **height**: `number`

Defined in: [src/results.ts:57](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L57)

The height of the image, in the units of `width`.

***

### width

> `readonly` **width**: `number`

Defined in: [src/results.ts:55](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L55)

The width of the image, in pixels for a raster image, or in points for a vector image.

## Methods

### toBlob()

> **toBlob**(`encoding?`): `Promise`\<`Blob`\>

Defined in: [src/results.ts:75](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L75)

Get the image as a blob. The document scanner draws a vector image as pixels
first.

#### Parameters

##### encoding?

[`ImageEncoding`](../type-aliases/ImageEncoding.md)

The format of the blob. Without it,
[original](ScannedPage.md#original) gives the blob that the page arrived as,
and [processed](ScannedPage.md#processed) gives a PNG image.

#### Returns

`Promise`\<`Blob`\>

The encoded image.

***

### toCanvas()

> **toCanvas**(`options?`): `Promise`\<`HTMLCanvasElement`\>

Defined in: [src/results.ts:65](https://github.com/Dynamsoft/document-scanner-javascript/blob/main/src/results.ts#L65)

Draw the image on a new canvas.

#### Parameters

##### options?

The canvas is `scale` times the size of the image. `scale` is 1
by default.

###### scale?

`number`

#### Returns

`Promise`\<`HTMLCanvasElement`\>

The canvas, with the image drawn on it.
