Before running an example make sure that GroupDocs.Annotation has been installed successfully.
We offer multiple solutions on how you can run GroupDocs.Annotation examples, by building your own or using our back-end or front-end examples out-of-the-box.
Build project from scratch
To build a project from scratch, follow these steps:
Open Visual Studio and navigate to File -> New -> Project.
Select the appropriate project type - Console App, ASP.NET Web App etc.
Install GroupDocs.Annotation for .NET from NuGet or official GroupDocs website as described in the guide.
Develop the application using GroupDocs.Annotation for .NET like this:
// Create list of annotationsList<AnnotationBase>annotations=newList<AnnotationBase>(){newAreaAnnotation(){PageNumber=0,Box=newRectangle(100,100,100,100),Message="area"},newEllipseAnnotation(){PageNumber=0,Box=newRectangle(200,200,80,80),Message="ellipse"}};// Create annotatorusing(Annotatorannotator=newAnnotator("C:\output\input.pdf")){// Add annotationsannotator.Add(annotations);// Save result to "C:\output\result.pdf"annotator.Save("C:\output\result.pdf",newSaveOptions());}
Build and run your project.
Rendered document pages appears in the C:\\output\\ directory.
Run back-end examples
You can find the complete package of the GroupDocs.Annotation examples on GitHub. You can either download the ZIP file or clone the GitHub repository using your any git client. If you downloaded the ZIP file, extract the folders to the local disk. The extracted files and folders look as follows:
Find the CSharp solution file. The project is created in Microsoft Visual Studio 2019. The Resources folder contains all the sample documents and images used in the examples. To run the examples, open the solution file with Visual Studio and build the project. If needed, add missing references of GroupDocs.Annotation. All the functions are called in the RunExamples.cs file. Uncomment the function(s) you want to run and comment the rest.
Open solution with the Visual Studio. Update common parameters in web.config and example related properties in configuration.yml to meet your requirements.
Open solution with the Visual Studio. Update common parameters in web.config and example related properties in the configuration.yml to meet your requirements.
Use the Docker image to try GroupDocs.Annotation for .NET features. Execute the following commands to run GroupDocs.Annotation for .NET from docker image:
mkdir DocumentSamples
mkdir Licenses
docker run -p 8080:8080 --env application.hostAddress=localhost -v `pwd`/DocumentSamples:/home/groupdocs/app/DocumentSamples -v `pwd`/Licenses:/home/groupdocs/app/Licenses groupdocs/annotation
## Open http://localhost:8080/annotation in your favorite browser.
Contribute
If you want to add or improve an example, we encourage you to contribute to the project. All examples in this repository are open source and can be freely used in your applications.
To contribute, fork the repository, edit the code and create a pull request. We will review the changes and include it in the repository if found helpful.
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.