API: Capture Screenshots & Signatures
Allows you to capture a screenshot of the current view of the screen and to save it locally as an image file. Signatures can also be captured by creating an HTML5 canvas for drawing on-screen via touch, then capturing the result.
Resulting files can be accessed directly on the device by a locally stored HTML page, manually transferred to a computer, or retrieved remotely through Dropbox Sync. Files can also be managed using the Manage Local Files API.
In this article
Requirements
- Integration of our JavaScript API into your webpage
- Sample code to run within the app and download for integration into your own project is available here.
- Best practices for working with the JavaScript API are available here.
- App Settings
- Content > JavaScript API > Access JavaScript API = By Import
- Storage of resulting files in Kiosk Pro's Documents folder
- Due to sandboxing in iOS/iPadOS, Kiosk Pro is unable to store local files outside of its own Documents folder.
Triggers via API Functions
Capture Screenshot
This function triggers a screen capture and saves the result in the local Kiosk Pro documents folder. As this results in an image file, the result can also be translated into a Base64 text string for upload to a database.
The sample code also shows an example of creating an HTML5 canvas for drawing a signature on-screen by touch - the result can then be captured by this call.
Format | saveScreenToPng(filename, x-axis, y-axis, width, height, callback); |
Parameters |
|
Callback format | callback(success); |
Callback return values | success - if defined, the function successfully captured and saved an image to the Kiosk Pro document's folder. |
Sample Code
- This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.
- To run sample code, set the app's homepage to kioskgroup.com/screencapture-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 1.3