Nutrient Instant usage on Android
To use Instant for Flutter, use the Pspdfkit.presentInstant()
method and parse a server URL and JSON Web Token (JWT) as its parameters. This will load the Instant document from a viewer.
The JWT should contain the following information:
-
Document ID — A unique document identifier that you want to view and collaborate on.
-
User information — The user name, email address, and other relevant details.
-
Permissions — What actions the user is allowed to perform on the document (viewing, annotating, or commenting).
-
Instant layers — Collaborative layers that will be used for the Instant document viewer.
Here’s an example of how to use the Pspdfkit.presentInstant()
method in a Flutter app:
import 'package:pspdfkit_flutter/pspdfkit.dart'; // Assume that `serverUrl` and the JWT are already defined. // Present the Instant document viewer. await Pspdfkit.presentInstant( serverUrl: serverUrl, jwt: jwt, );
You can also pass additional configurations to the Pspdfkit.presentInstant()
method to customize the behavior of the Instant document viewer.