Native snapshot capture for pixel-exact ID card export.
- Add this plugin to your Capacitor app package.json:
"card-snapshot": "file:../plugins/card-snapshot"
- Run
npm installin the mobile app. - Sync Capacitor:
npx cap sync
CardSnapshot.captureRect({ x, y, width, height, scale })
Returns:
base64PNGmimewidth,height(pixels)
- The JS app uses
window.devicePixelRatioasscale. - Snapshot is taken from the root view; crop uses the DOM rect.