capacitor-screenshot
v8.0.0
Published
This plugin take screenshot of the app or webpage
Maintainers
Readme
Maintainers
| Maintainer | GitHub | Social | LinkedIn | | ---------------------- | ------------------------------------- | --------------------------------- | ------------------------------------------------------------------ | | Luan Freitas (ludufre) | ludufre | @ludufre | Luan Freitas |
Installation
npm install capacitor-screenshot
ionic cap syncyarn install capacitor-screenshot
ionic cap syncpnpm add capacitor-screenshot
ionic cap syncConfiguration
Not needed.
Usage
import { Screenshot } from 'capacitor-screenshot';
...
Screenshot.take().then((ret: { base64: string }) => {
console.log(ret.base64); // or `data:image/png;base64,${ret.base64}`
});
// Or save to disk and get file path and web path
Screenshot.take({saveToDisk: true}).then((ret: { base64: string; path: string; webPath: string }) => {
console.log(ret);
});