# Printing Options

Default page size is ISO\_A4, function to set any other custom size

{% hint style="info" %}
You'll need to import the javascript file in your website before starting from this [link](https://docs.webtonative.com/javascript-apis/getting-started).
{% endhint %}

{% tabs %}
{% tab title="Plain JS" %}

```
window.WTN.Printing.setPrintSize({
    "printSize":"Your print size value", //Eg. ISO_A4, ISO_B1, JIS_B3
    "label":"Any custom value you want" //optional
})

```

{% endtab %}

{% tab title="ES 6+" %}

```
import { Printing } from "webtonative"

Printing.setPrintSize({
    "printSize":"Your print size value", //Eg. ISO_A4, ISO_B1, JIS_B3
    "label":"Any custom value you want" //optional
})
```

{% endtab %}
{% endtabs %}

printSize - Value of the page size that you want. Refer to the official docs for the supported values [link](https://developer.android.com/reference/android/print/PrintAttributes.MediaSize).

label (Optional) - To set label which is supported on selected devices when the print preview is loaded.

Feature taken live on 21/08/2024

## Print Using Function

Call the function to print either by passing an html content or the url of the page/website. (Available on Android Only)

{% tabs %}
{% tab title="Plain JS" %}
{% code overflow="wrap" %}

```
window.WTN.printFunction({
    "type":"Your print type", //Eg. html or url
    "url":"Link or html content" // Url of the page/website or html content that needs to be printed
})
```

{% endcode %}
{% endtab %}

{% tab title="ES 6+" %}

<pre><code><strong>import { printFunction } from "webtonative"
</strong><strong>
</strong><strong>printFunction({
</strong>    "type":"Your print type", //Eg. html or url
    "url":"Link or html content" // Url of the page/website or html content that needs to be printed
})
</code></pre>

{% endtab %}
{% endtabs %}

\*Feature was taken live on 01/07/2024 (Available on Android Only)


---

# 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.webtonative.com/javascript-apis/printing-options.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.
