Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

CardSnapshot Capacitor Plugin

Native snapshot capture for pixel-exact ID card export.

Installation (mobile app repo)

  1. Add this plugin to your Capacitor app package.json:
    • "card-snapshot": "file:../plugins/card-snapshot"
  2. Run npm install in the mobile app.
  3. Sync Capacitor:
    • npx cap sync

API

CardSnapshot.captureRect({ x, y, width, height, scale })

Returns:

  • base64 PNG
  • mime
  • width, height (pixels)

Notes

  • The JS app uses window.devicePixelRatio as scale.
  • Snapshot is taken from the root view; crop uses the DOM rect.