Screenshot

The Screenshot API allows your application to take screenshots of the current screen and save them into the phone.

Usage
//take a screenshot and save to a file
Screenshot.save('jpg', 50, 'myPrint.jpg')
    .then((result) => {
        console.log('ok', result.filePath); //should be path/to/myPrint.jpg
    })
    .catch((error) => {
        console.error(error);
    });
    
    //take a screenshot and get it as base64 string
    Screenshot.URI(40)
    .then((result) => {
        console.log(result.URI); // should be a base64 encoded string
    })
    .catch((error) => {
        console.error(error);
    });
window.Screenshot.save("jpg", 50, "myPrint.jpg")
    .then((result) => {
        console.log("ok", result.filePath); //should be path/to/myPrint.jpg
    })
    .catch((error) => {
        console.error(error);
    });

...

window.Screenshot.URI(40)
    .then((result) => {
        console.log(result.URI); // should be a base64 encoded string
    })
    .catch((error) => {
        console.error(error);
    });
window.Screenshot.save("jpg", 50, "myPrint.jpg")
    .then((result) => {
        console.log("ok", result.filePath); //should be path/to/myPrint.jpg
    })
    .catch((error) => {
        console.error(error);
    });

...

window.Screenshot.URI(40)
    .then((result) => {
        console.log(result.URI); // should be a base64 encoded string
    })
    .catch((error) => {
        console.error(error);
    });
(<any>window).Screenshot.save("jpg", 50, "myPrint.jpg")
    .then((result) => {
        console.log("ok", result.filePath); //should be path/to/myPrint.jpg
    })
    .catch((error) => {
        console.error(error);
    });

(<any>window).Screenshot.URI(40)
    .then((result) => {
        console.log(result.URI); // should be a base64 encoded string
    })
    .catch((error) => {
        console.error(error);
    });
window.Screenshot.save("jpg", 50, "myPrint.jpg")
    .then((result) => {
        console.log("ok", result.filePath); //should be path/to/myPrint.jpg
    })
    .catch((error) => {
        console.error(error);
    });

...

window.Screenshot.URI(40)
    .then((result) => {
        console.log(result.URI); // should be a base64 encoded string
    })
    .catch((error) => {
        console.error(error);
    });

Table of Contents

Classes


Screenshot

save
save(type: string, quality: int, filename: string): Promise<string>

Take screenshot with jpg or png file type, custom quality and a defined filename and returns the filepath.

The screenshot files are stored in Application Directory for default.


PARAMETERS
type: string"jpg"|"png"
quality: int
filename: string

RETURN
returns: Promise<string> (should be the filepath)
PERMISSIONS

This method requires STORAGE Permission set on Fawi Office - publish settings.

URI
URI(quality: int): Promise<string>

Take screenshot and get it as Data URI.


PARAMETERS
quality: int 0 - 100

RETURN
returns: Promise<string>
PERMISSIONS

This method requires STORAGE Permission set on Fawi Office - publish settings.