Skip to main content
The capture object is an instance accessible from the main MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as webViewer from the initMuPDFWebViewer() promise!

capture

The capture object has the following methods:

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 }>
required
A Promise that resolves to the captured image bytes.
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.
Example