# canvasGenerateFrom

## Description

Converts a file data to a canvas, canvas are mainly used for printing.

### Platform Supported

* Web
* Mobile

## Input / Parameter

| Name         | Description                                                                                | Data Type      | Default | Options          | Required |
| ------------ | ------------------------------------------------------------------------------------------ | -------------- | ------- | ---------------- | -------- |
| type         | The data type of the file to be converted, basically what is the data type of the 'value'. | Text           | base64  | base64           | No       |
| value        | The data of the file to be converted.                                                      | Any            | -       | -                | Yes      |
| fileType     | The file type of the file to be converted, basically what is the file type of the 'value'. | Text           | image   | image, pdf       | No       |
| documentSize | If the 'fileType' is 'pdf', this parameter is used to scale the size appropriately.        | Text or Number | -       | a4, {Any Number} | No       |

## Output

| Description                                               | Output Type |
| --------------------------------------------------------- | ----------- |
| Returns 'true' or 'false', based on the execution status. | Boolean     |

## Callback

### callback

The function to be executed when the canvas is generated successfully.

| Description              | Output Type                                                                           |
| ------------------------ | ------------------------------------------------------------------------------------- |
| Returns the html canvas. | [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) |

### errCallback

The function to be executed when the canvas is not generated.

| Description        | Output Type |
| ------------------ | ----------- |
| Returns the error. | Text/Object |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/app/canvasgeneratefrom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
