How to control different versions of annotations in .NET
How to control different versions of annotations in .NET
Leave feedback
On this page
What is Version Control?
Version control is the method used tracking and recording changes in documents that occur over time. Versioning organizes the history of changes in a logical order, and allows for review or version rollbacks if needed.
In almost any business or organization, there will arise the need for changes in documents or files. Often, documents (whether paper or electronic) are passed around, and it is up to each individual to determine how to manage the changes. More frequently, individuals have their own separate and unique ways of tracking versions. It is not hard to see how this can quickly create confusion and disorder.
GroupDocs.Annotation as a document management system has it’s own versioning mechanism. It solves the problems of tracking changes by retaining versions inside a document. So, our annotator allows you not only to add or remove annotations, but also to rollback and get all changes that were applied to this document using our .NET API.
How it works in .NET API
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. When you are opening a file, by default the latest lervsion os the document is laoded. So you can easily swap between different changes made with GroupDocs.Annotation. And of course you can set your own version names.
Working with versioning in .NET API
Add Version with custom name
If you want to swap between versions easily you might need to have ability to set custom versions names.
In this scenario, you can label specific versions to represent status and relevance. This approach enables other people to find a specific version for a particular state in the editing process.
Here the code that demonstrates how to save version with custom name:
Type of Version property is object, so it support any type, and you can use any variable as version variable
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, this paragraph is for you. With our annotator you can easily get all previous version by running just 1 line of code. You could do this by calling GetVersionsList method of Annotator object:
Here the code that demonstrates how to get list of versions keys:
Annotator.GetVersionList() returns list of objects because it supports any type of key. But if you used some specified keys as string - you can convert it.
In short, we have learned how to work with document versioning using .NET API. We have shown how you can name our versions, how to get all existed versions, how to get all changes by version name, and how to to load a specific version of the document. We have covered most important part of our .NET API functionality. Now, you should be confident to build your own document annotator .NET application.
More resources
Advanced Usage Topics
To learn more about document annotating features, please refer to the advanced usage section.
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.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.