Versioning of annotated documents
Since from 21.7. Every time you are saving file using Annotator.Save() method - you implicitly create a new version of the annotated file. Versions list stores not document, it keeps annotations that you add, remove, and change. So you can easy swap between different changes made with GroupDocs.Annotation. And of course you can set your version names.
By default, they are created using unique GUID keys. Next, each aspect of using versions will be considered. The API execution logic has not changed, so you do not need to change your code to use it as before. The latest version of document is loaded by default.
The update is fully compatible with previous and next updates (The latest saved version will be used), however, using versions on previous versions is not possible and the list of versions in this document will not be changed. And If you update file from 20.4+ using 20.2 and lower few times, after loading this document on 20.4+ only last changes will be added as new version.
Add Version with custom name
If you want to swap between versions easily you might need to have ability to set custom versions names.
Here the code that demonstrates how to save version with custom name:
Get List of All version keys on a document
If you don’t know what versions were added earlier or want to know versions count Here the code that demonstrates how to get list of versions keys, you could do this calling GetVersionsList method of Annotator:
Get List of Annotations using version key
If you need to get list of annotations you can use Annotator.GetVersion() method Here code that demonstrates how to get list of annotations from specific version of document
Load Document of custom Version
Using LoadOptions.Version property you could load specific version of annotated document Here the code that demonstrates how load version using version property:
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Annotation for .NET examples, plugins, and showcase
- GroupDocs.Annotation for Java examples, plugins, and showcase
- Document Annotation for .NET MVC UI Example
- Document Annotation for .NET App WebForms UI Modern Example
- Document Annotation for Java App Dropwizard UI Modern Example
- Document Annotation for Java Spring UI Example
Free Online App
Along with full-featured .NET library we provide simple but powerful free Apps. You are welcome to annotate your PDF, DOC or DOCX, XLS or XLSX, PPT or PPTX, PNG and other documents with free to use online GroupDocs Annotation App.