Set annotation author on Android

Each annotation created by your users will contain the annotation author name. By default, Nutrient will ask your users for this name the first time they create an annotation.

Annotation creator dialog

You can programmatically set the annotation creator name using PSPDFKitPreferences#setAnnotationCreator. If you do so, we won’t display the annotation creator dialog for your users. If you want to reset the creator name, you can call PSPDFKitPreferences#resetAnnotationCreator, which will bring up the annotation creator name dialog again the next time an annotation is created. To see if the user has already entered a name, you can call PSPDFKitPreferences#isAnnotationCreatorSet, like so:

// Check if the annotation creator has already been set.
if (PSPDFKitPreferences.get(context).isAnnotationCreatorSet()) {
    // Ask user for the annotation creator.
    ...
    // Set the creator to PSPDFKit preferences.
    PSPDFKitPreferences.get(context).setAnnotationCreator(annotationCreator)
}
// Check if the annotation creator has already been set.
if (PSPDFKitPreferences.get(context).isAnnotationCreatorSet()) {
    // Ask user for the annotation creator name.
    ...
    // Set the creator to PSPDFKit preferences.
    PSPDFKitPreferences.get(context).setAnnotationCreator(annotationCreator);
}