Mobile Document Scanner API Reference / VectorImage
Interface: VectorImage
Defined in: src/results.ts:87
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
Properties
height
readonlyheight:number
Defined in: src/results.ts:57
The height of the image, in the units of width.
Inherited from
kind
readonlykind:"vector"
Defined in: src/results.ts:88
width
readonlywidth:number
Defined in: src/results.ts:55
The width of the image, in pixels for a raster image, or in points for a vector image.
Inherited from
Methods
toBlob()
toBlob(
encoding?):Promise<Blob>
Defined in: src/results.ts:75
Get the image as a blob. The document scanner draws a vector image as pixels first.
Parameters
encoding?
The format of the blob. Without it, original gives the blob that the page arrived as, and processed gives a PNG image.
Returns
Promise<Blob>
The encoded image.
Inherited from
toCanvas()
toCanvas(
options?):Promise<HTMLCanvasElement>
Defined in: src/results.ts:65
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
toPdf()
toPdf():
Promise<Blob>
Defined in: src/results.ts:90
Copy the page into a one-page PDF that keeps its text and drawing objects.
Returns
Promise<Blob>