Some test text!
Xamarin / Guides / Annotation sync (Android)
Annotations can be synced in realtime to allow for collaboration between clients.
Apryse supports annotation syncing between different clients to allow for collaboration. All the required locking, change tracking, merging and view updating are handled internally. Below are instructions on how to handle the import and export of annotation changes on the client side. While the server component is not described here, that implementation would be straightforward. The server would receive XFDF XML data, which it would then pass onto all other active clients that are part of the collaboration session. The clients take care of the updating. The server can store any XFDF data as it likes, since the data is just an XML string.
Here are a few requirements for syncing to work as expected:
Alice
was used for the userId, however, was later changed to AliceB
, the viewer will no longer treat it as the same user. Therefore, we recommend that you generate a UUID for each user.Add the following after ToolManager
is initialized:
// supply a permanent and unique userId here
mToolManager.EnableAnnotManager("12345-67890-ABCD-EFGH");
mToolManager.AnnotManager.LocalChanged += (sender, e) =>
{
Console.WriteLine("LocalChanged: action: " + e.Action + ", xfdf: " + e.XfdfCommand);
// a local annotation change event has happened,
// now is the time to send the XFDF command string to your remote service
// action is one of {@link AnnotManager.AnnotationAction#ADD}
// {@link AnnotManager.AnnotationAction#MODIFY}
// {@link AnnotManager.AnnotationAction#DELETE}
// {@link AnnotManager.AnnotationAction#UNDO}
// {@link AnnotManager.AnnotationAction#REDO}
// xfdfCommand is the XFDF command string, modification to this string is not recommended
};
When an annotation change event is received from a remote service, add the following to notify the viewer about the change:
public void ReceivedAnnotationEvents(String xfdfCommand)
{
mToolManager.AnnotManager?.OnRemoteChange(xfdfCommand);
}
To jump to an annotation by id:
public void JumpToAnnotation(String annotId)
{
mToolManager.AnnotManager?.JumpToAnnot(annotId);
}
Trial setup questions? Ask experts on Discord
Need other help? Contact Support
Pricing or product questions? Contact Sales