# Interface: VectorImage

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

# Interface: VectorImage

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

A page from a PDF file that keeps the text and drawing objects of the page. The
document scanner does not import PDF files yet, so no page is a vector image.

## Extends

- [`PageImageBase`](PageImageBase.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`.

#### Inherited from

[`PageImageBase`](PageImageBase.md).[`height`](PageImageBase.md#height)

***

### kind

> `readonly` **kind**: `"vector"`

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

***

### 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.

#### Inherited from

[`PageImageBase`](PageImageBase.md).[`width`](PageImageBase.md#width)

## 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.

#### Inherited from

[`PageImageBase`](PageImageBase.md).[`toBlob`](PageImageBase.md#toblob)

***

### 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.

#### Inherited from

[`PageImageBase`](PageImageBase.md).[`toCanvas`](PageImageBase.md#tocanvas)

***

### toPdf()

> **toPdf**(): `Promise`\<`Blob`\>

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

Copy the page into a one-page PDF that keeps its text and drawing objects.

#### Returns

`Promise`\<`Blob`\>
