Skip to content

Commit acb7927

Browse files
committed
Updated sources
1 parent c5954b8 commit acb7927

File tree

163 files changed

+19341
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+19341
-31
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2003-2018 Aspose Pty Ltd
3+
Copyright (c) 2003-2019 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,59 @@
1-
# GroupDocs.Annotation for Cloud SDKs
2-
This folder contains SDKs for [GroupDocs.Annotation for Cloud](https://products.groupdocs.cloud/annotation/cloud) for various platforms.
1+
# GroupDocs.Annotation Cloud SDK for .NET
2+
This repository contains GroupDocs.Annotation Cloud SDK for .NET source code. This SDK allows you to work with GroupDocs.Annotation Cloud REST APIs in your .NET applications.
33

4-
# Currently Available SDKs
4+
## How to use the SDK?
5+
The complete source code is available in this repository folder, you can either directly use it in your project via NuGet package manager. For more details, please visit our [documentation website](https://docs.groupdocs.cloud/).
56

6-
Directory | Description
7-
--------- | -----------
8-
[.NET SDK](SDKs/NET) | GroupDocs.Annotation for Cloud .NET SDK
9-
10-
To use these SDKs, you will need App SID and App Key which can be looked up at [GroupDocs Cloud Dashboard](https://dashboard.groupdocs.cloud) (free registration in GroupDocs Cloud is required for this).
7+
## Dependencies
8+
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json)
119

1210
## Getting Started
1311

1412
```csharp
1513
using System;
1614
using System.Diagnostics;
1715
using GroupDocs.Annotation.Cloud.Sdk.Api;
18-
using GroupDocs.Annotation.Cloud.Sdk.Client;
19-
using GroupDocs.Annotation.Cloud.Sdk.Model;
2016

2117
namespace Example
2218
{
2319
public class Example
2420
{
25-
public void main()
21+
public void Main()
2622
{
27-
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
28-
var configuration = new Configuration
29-
{
30-
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
31-
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
32-
};
23+
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
24+
var appSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
25+
var appKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
3326

34-
var apiInstance = new AnnotationApi();
35-
var name = name_example; // string | The document name.
36-
var folder = folder_example; // string | The folder name. (optional)
37-
var password = password_example; // string | (optional)
27+
var api = new InfoApi(appSid, appKey);
3828

3929
try
4030
{
41-
// Removes annotations from document.
42-
System.IO.Stream result = apiInstance.DeleteCleanDocument(name, folder, password);
43-
Debug.WriteLine(result);
31+
// Get supported file formats
32+
var response = api.GetSupportedFileFormats();
33+
34+
foreach (var format in response.Formats)
35+
{
36+
Debug.Print(format.ToString());
37+
}
4438
}
4539
catch (Exception e)
4640
{
47-
Debug.Print("Exception when calling AnnotationApi.DeleteCleanDocument: " + e.Message );
41+
Debug.Print("Something went wrong: " + e.Message);
4842
}
49-
5043
}
5144
}
5245
}
5346
```
5447

55-
# Licensing
56-
All GroupDocs.Annotation for Cloud SDKs are licensed under [MIT License](LICENSE).
48+
## Licensing
49+
All GroupDocs.Annotation Cloud SDKs are licensed under [MIT License](LICENSE).
5750

58-
# Resources
51+
## Resources
5952
+ [**Website**](https://www.groupdocs.cloud)
6053
+ [**Product Home**](https://products.groupdocs.cloud/annotation)
6154
+ [**Documentation**](https://docs.groupdocs.cloud/display/annotationcloud/Home)
6255
+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/annotation)
63-
+ [**Blog**](https://blog.groupdocs.cloud/category/annotation)
56+
+ [**Blog**](https://blog.groupdocs.cloud/category/annotation)
57+
58+
## Contact Us
59+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/annotation).
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose Pty Ltd">
3+
// Copyright (c) 2003-2019 Aspose Pty Ltd
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
using System.Collections.Generic;
27+
using System.IO;
28+
using System.Linq;
29+
using GroupDocs.Annotation.Cloud.Sdk.Model;
30+
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
31+
using NUnit.Framework;
32+
33+
namespace GroupDocs.Annotation.Cloud.Sdk.Test.Api
34+
{
35+
public class AnnotationApiTests : BaseApiTest
36+
{
37+
[TestCase(@"cells\one-page.xlsx")]
38+
[TestCase(@"diagram\one-page.vsd")]
39+
[TestCase(@"email\one-page.emlx")]
40+
[TestCase(@"images\one-page.png")]
41+
[TestCase(@"pdf\one-page.pdf")]
42+
[TestCase(@"slides\one-page.pptx")]
43+
[TestCase(@"words\one-page.docx")]
44+
[TestCase(@"cells\ten-pages.xlsx")]
45+
[TestCase(@"diagram\ten-pages.vsd")]
46+
[TestCase(@"pdf\ten-pages.pdf")]
47+
[TestCase(@"slides\ten-pages.pptx")]
48+
[TestCase(@"words\ten-pages.docx")]
49+
[TestCase(@"cells\one-page-password.xlsx")]
50+
[TestCase(@"pdf\one-page-password.pdf")]
51+
[TestCase(@"slides\one-page-password.pptx")]
52+
[TestCase(@"words\one-page-password.docx")]
53+
[Order(1)]
54+
public void TestGetImport(string filePath)
55+
{
56+
var annotations = AnnotateApi.GetImport(new GetImportRequest(filePath));
57+
Assert.AreNotEqual(null, annotations);
58+
Assert.IsInstanceOf(typeof(AnnotationInfo), annotations[0]);
59+
}
60+
61+
[TestCase(@"cells\one-page.xlsx", Ignore = "")]
62+
[TestCase(@"diagram\one-page.vsd")]
63+
[TestCase(@"email\one-page.emlx")]
64+
[TestCase(@"images\one-page.png")]
65+
[TestCase(@"pdf\one-page.pdf")]
66+
[TestCase(@"slides\one-page.pptx")]
67+
[TestCase(@"words\one-page.docx")]
68+
[TestCase(@"cells\ten-pages.xlsx", "Area,Point", true, 2, 5, Ignore = "")]
69+
[TestCase(@"diagram\ten-pages.vsd", "Area,Point", true, 2, 5)]
70+
[TestCase(@"pdf\ten-pages.pdf", "Area,Point", true, 2, 5)]
71+
[TestCase(@"slides\ten-pages.pptx", "Area,Point", true, 2, 5)]
72+
[TestCase(@"words\ten-pages.docx", "Area,Point", true, 2, 5)]
73+
[TestCase(@"cells\one-page-password.xlsx", null, false, -1, -1, "password", Ignore = "")]
74+
[TestCase(@"pdf\one-page-password.pdf", null, false, -1, -1, "password")]
75+
[TestCase(@"slides\one-page-password.pptx", null, false, -1, -1, "password")]
76+
[TestCase(@"words\one-page-password.docx", null, false, -1, -1, "password")]
77+
[Order(2)]
78+
public void TestGetExport(string filePath, string annotationTypes = null, bool annotatedPages = false, int firstPage = -1, int lastPage = -1, string password = null)
79+
{
80+
GetExportRequest request = new GetExportRequest(filePath, annotationTypes, annotatedPages, firstPage, lastPage, password);
81+
var result = AnnotateApi.GetExport(request);
82+
Assert.IsNotNull(result);
83+
Assert.IsInstanceOf(typeof(Stream), result);
84+
}
85+
86+
[TestCase(@"cells\one-page.xlsx")]
87+
[TestCase(@"diagram\one-page.vsd")]
88+
[TestCase(@"email\one-page.emlx")]
89+
[TestCase(@"images\one-page.png")]
90+
[TestCase(@"pdf\one-page.pdf")]
91+
[TestCase(@"slides\one-page.pptx")]
92+
[TestCase(@"words\one-page.docx")]
93+
[TestCase(@"cells\ten-pages.xlsx")]
94+
[TestCase(@"diagram\ten-pages.vsd")]
95+
[TestCase(@"pdf\ten-pages.pdf")]
96+
[TestCase(@"slides\ten-pages.pptx")]
97+
[TestCase(@"words\ten-pages.docx")]
98+
[TestCase(@"cells\one-page-password.xlsx")]
99+
[TestCase(@"pdf\one-page-password.pdf")]
100+
[TestCase(@"slides\one-page-password.pptx")]
101+
[TestCase(@"words\one-page-password.docx")]
102+
[Order(3)]
103+
public void TestDeleteAnnotations(string filePath)
104+
{
105+
AnnotateApi.DeleteAnnotations(new DeleteAnnotationsRequest(filePath));
106+
}
107+
108+
[TestCase(@"cells\one-page.xlsx")]
109+
[TestCase(@"diagram\one-page.vsd")]
110+
[TestCase(@"email\one-page.emlx")]
111+
[TestCase(@"images\one-page.png")]
112+
[TestCase(@"pdf\one-page.pdf")]
113+
[TestCase(@"slides\one-page.pptx")]
114+
[TestCase(@"words\one-page.docx")]
115+
[TestCase(@"cells\one-page-password.xlsx")]
116+
[TestCase(@"pdf\one-page-password.pdf")]
117+
[TestCase(@"slides\one-page-password.pptx")]
118+
[TestCase(@"words\one-page-password.docx")]
119+
[Order(0)]
120+
public void TestPostAnnotations(string filePath)
121+
{
122+
var request = new PostAnnotationsRequest(filePath, GetAnnotationsTestBody());
123+
AnnotateApi.PostAnnotations(request);
124+
}
125+
126+
[TestCase(@"cells\ten-pages.xlsx")]
127+
[TestCase(@"diagram\ten-pages.vsd")]
128+
[TestCase(@"pdf\ten-pages.pdf")]
129+
[TestCase(@"slides\ten-pages.pptx")]
130+
[TestCase(@"words\ten-pages.docx")]
131+
[Order(0)]
132+
public void TestPostAnnotationsManyPages(string filePath)
133+
{
134+
var request = new PostAnnotationsRequest(filePath, GetAnnotationsTestBodyManyPages());
135+
AnnotateApi.PostAnnotations(request);
136+
}
137+
138+
private List<AnnotationInfo> GetAnnotationsTestBody()
139+
{
140+
AnnotationInfo[] annotations = {
141+
new AnnotationInfo
142+
{
143+
AnnotationPosition = new Point { X = 852, Y = 59.388262910798119 },
144+
Box = new Rectangle { X = 375.89276123046875, Y = 59.388263702392578, Width = 88.7330551147461, Height = 37.7290153503418 },
145+
PageNumber = 0,
146+
PenColor = 1201033,
147+
PenStyle = 0,
148+
PenWidth = 1,
149+
Type = AnnotationInfo.TypeEnum.Area,
150+
CreatorName = "Anonym A."
151+
}
152+
};
153+
return annotations.ToList();
154+
}
155+
156+
private List<AnnotationInfo> GetAnnotationsTestBodyManyPages()
157+
{
158+
AnnotationInfo[] annotations = {
159+
new AnnotationInfo
160+
{
161+
AnnotationPosition = new Point { X = 852, Y = 59.388262910798119 },
162+
Box = new Rectangle { X = 375.89276123046875, Y = 59.388263702392578, Width = 88.7330551147461, Height = 37.7290153503418 },
163+
PageNumber = 0,
164+
PenColor = 1201033,
165+
PenStyle = 0,
166+
PenWidth = 1,
167+
Type = AnnotationInfo.TypeEnum.Distance,
168+
CreatorName = "Anonym A."
169+
},
170+
new AnnotationInfo
171+
{
172+
AnnotationPosition = new Point { X = 852, Y = 59.388262910798119 },
173+
Box = new Rectangle { X = 375.89276123046875, Y = 59.388263702392578, Width = 88.7330551147461, Height = 37.7290153503418 },
174+
PageNumber = 2,
175+
PenColor = 1201033,
176+
PenStyle = 0,
177+
PenWidth = 1,
178+
Type = AnnotationInfo.TypeEnum.Area,
179+
CreatorName = "Anonym A."
180+
},
181+
new AnnotationInfo
182+
{
183+
AnnotationPosition = new Point { X = 852, Y = 59.388262910798119 },
184+
Box = new Rectangle { X = 375.89276123046875, Y = 59.388263702392578, Width = 88.7330551147461, Height = 37.7290153503418 },
185+
PageNumber = 4,
186+
Type = AnnotationInfo.TypeEnum.Point,
187+
CreatorName = "Anonym A."
188+
},
189+
new AnnotationInfo
190+
{
191+
AnnotationPosition = new Point { X = 852, Y = 59.388262910798119 },
192+
Box = new Rectangle { X = 375.89276123046875, Y = 59.388263702392578, Width = 88.7330551147461, Height = 37.7290153503418 },
193+
PageNumber = 5,
194+
PenColor = 1201033,
195+
PenStyle = 0,
196+
PenWidth = 1,
197+
Type = AnnotationInfo.TypeEnum.Arrow,
198+
CreatorName = "Anonym A."
199+
}
200+
};
201+
return annotations.ToList();
202+
}
203+
}
204+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose Pty Ltd">
3+
// Copyright (c) 2003-2019 Aspose Pty Ltd
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
namespace GroupDocs.Annotation.Cloud.Sdk.Test.Api
27+
{
28+
using NUnit.Framework;
29+
30+
public class AnnotationFormatsApiTests : BaseApiTest
31+
{
32+
/// <summary>
33+
/// Test GetSupportedFileFormats
34+
/// </summary>
35+
[Test]
36+
public void GetSupportedFileFormatsTest()
37+
{
38+
var response = InfoApi.GetSupportedFileFormats();
39+
40+
Assert.IsTrue(response.Formats.Count > 0);
41+
foreach (var entry in response.Formats)
42+
{
43+
Assert.IsNotEmpty(entry.Extension);
44+
Assert.IsNotEmpty(entry.FileFormat);
45+
}
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)