API Questions for Ratta / Supernote Team
Hi, I’m building "Clipper" (a Supernote plugin that clips text and image regions from documents into a dashboard and inserts them into notes & Digests). A few things I can't do through `sn-plugin-lib` and would love guidance from Ratta or other plugin authors.
Device: Manta (A5X2, 1920×2560), current `sn-plugin-lib`
How do I capture a region of the currently rendered reader page?
- PluginDocAPI.generateDocImage(docPath, page, pngPath, size) works for PDF files; however, when I use this to capture EPUB files, it does not show the same page. At times, it is shifted to a different paragraph, section, and sometimes a different page.
- Lasso sticker APIs operate on note elements (`editDataTypes`) and will not fire on the contents of a PDF/EPUB.
Is there a supported way to get the reader’s current rendered page as an image?
- Is there a way I can get the offsets of an EPUB document being displayed in the reader How are the other developers currently achieving this?
How to position an image in a note programmatically
- PluginNoteAPI.insertImage(path) places the image in the center, regardless of existing content. When I add two images, they overlap, are the same size, and cannot be separated.
Question: Is there a supported way to insert an image at a specific rect, or to reposition an inserted image (an `insertImage` variant that takes coordinates, or the minimal valid picture element for `insertElements`)?
Is the use of `screencap` ok?
- Is relying on `screencap` via the system-uid privilege acceptable/supported, or is it discouraged/likely to break in a future firmware update? If it's not something you want plugins doing, an official "capture current reader view" API would let me migrate off it.
u/Dunn-sn
u/spazzboi