For the complete documentation index, see llms.txt. This page is also available as Markdown.

Printing Options API

Print web content directly using the WebToNative JavaScript API. Configure printing options for a seamless Android experience.

The default page size is ISO_A4, a function to set any other custom size

You'll need to import the JavaScript file into your website before starting from this link.

window.WTN.Printing.setPrintSize({
    "printSize":"Your print size value", //Eg. ISO_A4, ISO_B1, JIS_B3
    "label":"Any custom value you want" //optional
})
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
})

printSize - Value of the page size that you want. Refer to the official docs for the supported values link.

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

Feature taken live on 21/08/2024

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

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
})
import { printFunction } from "webtonative"

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
})

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

Last updated