When users create annotations in WebViewer, the Author property of the annotation is set to the current user (Guest if no user was set). WebViewer enforces annotation permissions by only allowing the current user to edit annotations that have an Author value that matches their username.
In the XFDF, the `title` attribute corresponds to the author of the annotation.
Since it's possible that multiple users could have the same username or they may want to change their username in the future, it can be more convenient to set the annotation Author to be a unique ID representing the user instead. Otherwise, you would have to update the XFDF data for every annotation created by the user anytime the username changes. However, this would cause the IDs to be shown instead of a friendly name.
In the following example, we will show how to map a userId (a unique identifier that won't change after being assigned) to a display name.
Map a userId to a Display Author
Add a mapping function with setAnnotationDisplayAuthorMap to map the userId to a display author, which will be shown as the annotation author name in WebViewer.
For 7.x and below the mapping function takes in an annotation instead of a userId.
If you have added a mapping function, it should display those unique IDs as much friendlier names while the ID is still used underneath for permission checking.
You can also set whether to use the display name as the author name in the XFDF whenever exporting the annotations, by passing the option useDisplayAuthor: true to exportAnnotations.