Skip to content

Commit 7c140af

Browse files
committed
Updated to v18.10
1 parent 379cfc4 commit 7c140af

13 files changed

+1015
-184
lines changed

src/Aspose.Pdf.Cloud.Sdk.Test/AnnotationsTests.cs

Lines changed: 2 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void DeleteDocumentAnnotationsTest()
8181
Assert.That(response.Code, Is.EqualTo(200));
8282
}
8383

84-
84+
8585
/// <summary>
8686
/// Test GetPageAnnotations
8787
/// </summary>
@@ -91,7 +91,7 @@ public void GetPageAnnotationsTest()
9191
var response = PdfApi.GetPageAnnotations(Name, PageNumber, folder: TempFolder);
9292
Assert.That(response.Code, Is.EqualTo(200));
9393
}
94-
94+
9595

9696
/// <summary>
9797
/// Test DeletePageAnnotations
@@ -113,182 +113,5 @@ public void DeleteAnnotationTest()
113113
var response = PdfApi.DeleteAnnotation(Name, AnnotationId, folder: TempFolder);
114114
Assert.That(response.Code, Is.EqualTo(200));
115115
}
116-
117-
/// <summary>
118-
/// Test PostPageFreeTextAnnotations
119-
/// </summary>
120-
[Test]
121-
public void PostPageFreeTextAnnotationsTest()
122-
{
123-
List<FreeTextAnnotation> annotations = new List<FreeTextAnnotation>
124-
{
125-
new FreeTextAnnotation()
126-
{
127-
Name = "Test Free Text",
128-
TextStyle = new TextStyle(FontSize: 12, Font: "Arial", ForegroundColor: new Color(0xFF, 0, 0xFF, 0), BackgroundColor: new Color(0xFF, 0xFF, 0, 0)),
129-
Rect = new RectanglePdf(100, 100, 200, 200),
130-
Flags = new List<AnnotationFlags> { AnnotationFlags.Default},
131-
HorizontalAlignment = HorizontalAlignment.Center,
132-
Intent = FreeTextIntent.FreeTextTypeWriter,
133-
RichText = "Rich Text",
134-
Subject = "Text Box Subj",
135-
ZIndex = 1,
136-
Justification = Justification.Center,
137-
Title = "Title"
138-
}
139-
};
140-
141-
var response = PdfApi.PostPageFreeTextAnnotations(Name, 1, annotations, folder: TempFolder);
142-
Assert.That(response.Code, Is.EqualTo(201));
143-
}
144-
145-
/// <summary>
146-
/// Test GetDocumentFreeTextAnnotations
147-
/// </summary>
148-
[Test]
149-
public void GetDocumentFreeTextAnnotationsTest()
150-
{
151-
var response = PdfApi.GetDocumentFreeTextAnnotations(Name, folder: TempFolder);
152-
Assert.That(response.Code, Is.EqualTo(200));
153-
}
154-
155-
/// <summary>
156-
/// Test GetDocumentFreeTextAnnotations
157-
/// </summary>
158-
[Test]
159-
public void GetPageFreeTextAnnotationsTest()
160-
{
161-
var response = PdfApi.GetPageFreeTextAnnotations(Name, PageNumber, folder: TempFolder);
162-
Assert.That(response.Code, Is.EqualTo(200));
163-
}
164-
165-
166-
/// <summary>
167-
/// Test GetFreeTextAnnotation
168-
/// </summary>
169-
[Test]
170-
public void GetFreeTextAnnotationTest()
171-
{
172-
var freeTextresponse = PdfApi.GetDocumentFreeTextAnnotations(Name, folder: TempFolder);
173-
string annotationId = freeTextresponse.Annotations.List[0].Id;
174-
175-
var response = PdfApi.GetFreeTextAnnotation(Name, annotationId, folder: TempFolder);
176-
Assert.That(response.Code, Is.EqualTo(200));
177-
}
178-
179-
/// <summary>
180-
/// Test PutFreeTextAnnotation
181-
/// </summary>
182-
[Test]
183-
public void PutFreeTextAnnotationTest()
184-
{
185-
FreeTextAnnotation annotation = new FreeTextAnnotation()
186-
{
187-
Name = "Test Free Text",
188-
TextStyle = new TextStyle(FontSize: 12, Font: "Arial", ForegroundColor: new Color(0xFF, 0, 0xFF, 0), BackgroundColor: new Color(0xFF, 0xFF, 0, 0)),
189-
Rect = new RectanglePdf(100, 100, 200, 200),
190-
Flags = new List<AnnotationFlags> { AnnotationFlags.Default },
191-
HorizontalAlignment = HorizontalAlignment.Center,
192-
Intent = FreeTextIntent.FreeTextTypeWriter,
193-
RichText = "Updated Text",
194-
Subject = "Text Box Subj",
195-
ZIndex = 1,
196-
Justification = Justification.Center,
197-
Title = "Title"
198-
};
199-
200-
var freeTextresponse = PdfApi.GetDocumentFreeTextAnnotations(Name, folder: TempFolder);
201-
string annotationId = freeTextresponse.Annotations.List[0].Id;
202-
203-
var response = PdfApi.PutFreeTextAnnotation(Name, annotationId, annotation, folder: TempFolder);
204-
Assert.That(response.Code, Is.EqualTo(201));
205-
}
206-
207-
/// <summary>
208-
/// Test GetDocumentTextAnnotations
209-
/// </summary>
210-
[Test]
211-
public void GetDocumentTextAnnotationsTest()
212-
{
213-
var response = PdfApi.GetDocumentTextAnnotations(Name, folder: TempFolder);
214-
Assert.That(response.Code, Is.EqualTo(200));
215-
}
216-
217-
218-
/// <summary>
219-
/// Test GetDocumentTextAnnotations
220-
/// </summary>
221-
[Test]
222-
public void GetPageTextAnnotationsTest()
223-
{
224-
var response = PdfApi.GetPageTextAnnotations(Name, PageNumber, folder: TempFolder);
225-
Assert.That(response.Code, Is.EqualTo(200));
226-
}
227-
228-
229-
/// <summary>
230-
/// Test PostPageTextAnnotations
231-
/// </summary>
232-
[Test]
233-
public void PostPageTextAnnotationsTest()
234-
{
235-
List<TextAnnotation> annotations = new List<TextAnnotation>
236-
{
237-
new TextAnnotation()
238-
{
239-
Name = "Test Free Text",
240-
Rect = new RectanglePdf(100, 100, 200, 200),
241-
Flags = new List<AnnotationFlags> { AnnotationFlags.Default},
242-
HorizontalAlignment = HorizontalAlignment.Center,
243-
RichText = "Rich Text",
244-
Subject = "Text Box Subj",
245-
ZIndex = 1,
246-
Title = "Title"
247-
}
248-
};
249-
250-
var response = PdfApi.PostPageTextAnnotations(Name, 1, annotations, folder: TempFolder);
251-
Assert.That(response.Code, Is.EqualTo(201));
252-
}
253-
254-
255-
/// <summary>
256-
/// Test GetTextAnnotation
257-
/// </summary>
258-
[Test]
259-
public void GetTextAnnotationTest()
260-
{
261-
var textresponse = PdfApi.GetDocumentTextAnnotations(Name, folder: TempFolder);
262-
string annotationId = textresponse.Annotations.List[0].Id;
263-
264-
var response = PdfApi.GetTextAnnotation(Name, annotationId, folder: TempFolder);
265-
Assert.That(response.Code, Is.EqualTo(200));
266-
}
267-
268-
269-
/// <summary>
270-
/// Test PutTextAnnotation
271-
/// </summary>
272-
[Test]
273-
public void PutTextAnnotationTest()
274-
{
275-
TextAnnotation annotation = new TextAnnotation()
276-
{
277-
Name = "Test Free Text",
278-
Rect = new RectanglePdf(100, 100, 200, 200),
279-
Flags = new List<AnnotationFlags> { AnnotationFlags.Default },
280-
HorizontalAlignment = HorizontalAlignment.Center,
281-
RichText = "Updated Text",
282-
Subject = "Text Box Subj",
283-
ZIndex = 1,
284-
Title = "Title"
285-
};
286-
287-
var textresponse = PdfApi.GetDocumentTextAnnotations(Name, folder: TempFolder);
288-
string annotationId = textresponse.Annotations.List[0].Id;
289-
290-
var response = PdfApi.PutTextAnnotation(Name, annotationId, annotation, folder: TempFolder);
291-
Assert.That(response.Code, Is.EqualTo(201));
292-
}
293116
}
294117
}

src/Aspose.Pdf.Cloud.Sdk.Test/Aspose.Pdf.Cloud.Sdk.Test.Core.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@
3838
<Compile Include="AppendTests.cs" />
3939
<Compile Include="AttachmentsTests.cs" />
4040
<Compile Include="BookmarksTests.cs" />
41+
<Compile Include="CircleAnnotationsTests.cs" />
4142
<Compile Include="ConvertTests.cs" />
4243
<Compile Include="ConvertToPdfTests.cs" />
4344
<Compile Include="DocumentTests.cs" />
4445
<Compile Include="FieldsTests.cs" />
46+
<Compile Include="FreeTextAnnotationsTests.cs" />
4547
<Compile Include="ImagesTests.cs" />
46-
<Compile Include="LinksTests.cs" />
48+
<Compile Include="LineAnnotationsTests.cs" />
49+
<Compile Include="LinkAnnotationsTests.cs" />
4750
<Compile Include="MergeTests.cs" />
4851
<Compile Include="PageConvertToImageTests.cs" />
52+
<Compile Include="PolygonAnnotationsTests.cs" />
53+
<Compile Include="PolyLineAnnotationsTests.cs" />
4954
<Compile Include="PrivilegesTests.cs" />
55+
<Compile Include="SquareAnnotationsTests.cs" />
56+
<Compile Include="TextAnnotationsTests.cs" />
5057
<Compile Include="TextTests.cs" />
5158
<Compile Include="OcrTests.cs" />
5259
<Compile Include="PagesTests.cs" />

src/Aspose.Pdf.Cloud.Sdk.Test/Aspose.Pdf.Cloud.Sdk.Test.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,22 @@ OpenAPI spec version: 1.1
6363
<Compile Include="AppendTests.cs" />
6464
<Compile Include="AttachmentsTests.cs" />
6565
<Compile Include="BookmarksTests.cs" />
66+
<Compile Include="CircleAnnotationsTests.cs" />
6667
<Compile Include="ConvertTests.cs" />
6768
<Compile Include="ConvertToPdfTests.cs" />
6869
<Compile Include="DocumentTests.cs" />
6970
<Compile Include="FieldsTests.cs" />
71+
<Compile Include="FreeTextAnnotationsTests.cs" />
7072
<Compile Include="ImagesTests.cs" />
71-
<Compile Include="LinksTests.cs" />
73+
<Compile Include="LineAnnotationsTests.cs" />
74+
<Compile Include="LinkAnnotationsTests.cs" />
7275
<Compile Include="MergeTests.cs" />
7376
<Compile Include="PageConvertToImageTests.cs" />
77+
<Compile Include="PolygonAnnotationsTests.cs" />
78+
<Compile Include="PolyLineAnnotationsTests.cs" />
7479
<Compile Include="PrivilegesTests.cs" />
80+
<Compile Include="SquareAnnotationsTests.cs" />
81+
<Compile Include="TextAnnotationsTests.cs" />
7582
<Compile Include="TextTests.cs" />
7683
<Compile Include="OcrTests.cs" />
7784
<Compile Include="PagesTests.cs" />
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="AnnotationsTests.cs">
3+
// Copyright (c) 2018 Aspose.PDF Cloud
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.Net;
28+
using Aspose.Pdf.Cloud.Sdk.Model;
29+
using NUnit.Framework;
30+
31+
namespace Aspose.Pdf.Cloud.Sdk.Test
32+
{
33+
/// <summary>
34+
/// Class for testing Circle Annotations Api
35+
/// </summary>
36+
[TestFixture]
37+
public class CircleAnnotationsTests : TestsBase
38+
{
39+
private const string Name = "PdfWithAnnotations.pdf";
40+
private const int PageNumber = 2;
41+
42+
public override void SetUp()
43+
{
44+
base.SetUp();
45+
UploadFile(Name, Name);
46+
}
47+
48+
/// <summary>
49+
/// Test GetDocumentCircleAnnotations
50+
/// </summary>
51+
[Test]
52+
public void GetDocumentCircleAnnotationsTest()
53+
{
54+
var response = PdfApi.GetDocumentCircleAnnotations(Name, folder: TempFolder);
55+
Assert.That(response.Code, Is.EqualTo(200));
56+
}
57+
58+
/// <summary>
59+
/// Test GetPageCircleAnnotations
60+
/// </summary>
61+
[Test]
62+
public void GetPageCircleAnnotationsTest()
63+
{
64+
var response = PdfApi.GetPageCircleAnnotations(Name, PageNumber, folder: TempFolder);
65+
Assert.That(response.Code, Is.EqualTo(200));
66+
}
67+
68+
/// <summary>
69+
/// Test PostPageCircleAnnotations
70+
/// </summary>
71+
[Test]
72+
public void PostPageCircleAnnotationsTest()
73+
{
74+
List<CircleAnnotation> annotations = new List<CircleAnnotation>
75+
{
76+
new CircleAnnotation()
77+
{
78+
Name = "Test Circle Annotation",
79+
Rect = new RectanglePdf(100, 100, 200, 200),
80+
Flags = new List<AnnotationFlags> {AnnotationFlags.Hidden, AnnotationFlags.NoView},
81+
HorizontalAlignment = HorizontalAlignment.Center,
82+
RichText = "Rich Text",
83+
Subject = "Subj",
84+
ZIndex = 1,
85+
Title = "Title"
86+
}
87+
};
88+
89+
var response = PdfApi.PostPageCircleAnnotations(Name, 1, annotations, folder: TempFolder);
90+
Assert.That(response.Code, Is.EqualTo(201));
91+
}
92+
93+
/// <summary>
94+
/// Test GetCircleAnnotation
95+
/// </summary>
96+
[Test]
97+
public void GetCircleAnnotationTest()
98+
{
99+
var circleresponse = PdfApi.GetDocumentCircleAnnotations(Name, folder: TempFolder);
100+
string annotationId = circleresponse.Annotations.List[0].Id;
101+
102+
var response = PdfApi.GetCircleAnnotation(Name, annotationId, folder: TempFolder);
103+
Assert.That(response.Code, Is.EqualTo(200));
104+
}
105+
106+
/// <summary>
107+
/// Test PutCircleAnnotation
108+
/// </summary>
109+
[Test]
110+
public void PutCircleAnnotationTest()
111+
{
112+
CircleAnnotation annotation = new CircleAnnotation()
113+
{
114+
Name = "Updated Test",
115+
Rect = new RectanglePdf(100, 100, 200, 200),
116+
Flags = new List<AnnotationFlags> { AnnotationFlags.Hidden, AnnotationFlags.NoView },
117+
HorizontalAlignment = HorizontalAlignment.Center,
118+
RichText = "Rich Text Updated",
119+
Subject = "Subj Updated",
120+
ZIndex = 1,
121+
Title = "Title Updated"
122+
};
123+
124+
var lineResponse = PdfApi.GetDocumentCircleAnnotations(Name, folder: TempFolder);
125+
string annotationId = lineResponse.Annotations.List[0].Id;
126+
127+
var response = PdfApi.PutCircleAnnotation(Name, annotationId, annotation, folder: TempFolder);
128+
Assert.That(response.Code, Is.EqualTo(201));
129+
}
130+
}
131+
}

src/Aspose.Pdf.Cloud.Sdk.Test/FieldsTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ public void PutUpdateFieldTest()
9999
var field = new Field(
100100
Name: fieldName,
101101
Type: FieldType.Text,
102-
Values: new List<string> {"Text field updated value."});
102+
Values: new List<string> {"Text field updated value."},
103+
Rect: new RectanglePdf(125, 735, 200, 752)
104+
);
103105

104106
var response = PdfApi.PutUpdateField(name, fieldName, field, folder: TempFolder);
105107
Assert.That(response.Field, Is.Not.Null);

0 commit comments

Comments
 (0)