capture
object is an instance accessible from the main mupdfwv.MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as
mupdf
from the initMuPDFWebViewer() promise!capture
Thecapture
object has the following methods:
selectAndExport
selectAndExport()
Once this method is called it allows the user to select a region which is then exported as an image and returned as a promise with the image data.
- Returns:
Promise<{ imageBytes: Uint8Array }>
.
Captured images do not include viewer-only overlays such as those created with viewer.highlight(). To include highlighted regions in output, create real PDF annotations with annotation.add() first.