Skip to content

Commit 425e700

Browse files
committed
Updated sources
1 parent f8552c2 commit 425e700

10 files changed

Lines changed: 107 additions & 12 deletions

File tree

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-2019 Aspose Pty Ltd
3+
Copyright (c) 2003-2021 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

src/GroupDocs.Annotation.Cloud.Sdk.Test/Api/AnnotationInfoApiTests.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,47 @@
2323
// </summary>
2424
// --------------------------------------------------------------------------------------------------------------------
2525

26+
using GroupDocs.Annotation.Cloud.Sdk.Client;
2627
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
28+
using GroupDocs.Annotation.Cloud.Sdk.Test.Api.Internal;
2729
using NUnit.Framework;
2830

2931
namespace GroupDocs.Annotation.Cloud.Sdk.Test.Api
3032
{
3133
public class AnnotationInfoApiTests : BaseApiTest
3234
{
35+
[Test]
36+
public void TestGetInfoReturnsMissingFileInfo()
37+
{
38+
// Arrange
39+
var request = new GetInfoRequest();
40+
41+
// Act & Assert
42+
var ex = Assert.Throws<ApiException>(() => {
43+
InfoApi.GetInfo(request);
44+
});
45+
46+
Assert.AreEqual("Missing required parameter 'fileInfo' when calling GetInfo", ex.Message);
47+
}
48+
49+
[Test]
50+
public void TestGetInfoReturnsFileNotFound()
51+
{
52+
// Arrange
53+
var fileInfo = new Model.FileInfo
54+
{
55+
FilePath = TestFiles.NotExist.FullName,
56+
Password = TestFiles.NotExist.Password
57+
};
58+
var request = new GetInfoRequest(fileInfo);
59+
60+
// Act & Assert
61+
var ex = Assert.Throws<ApiException>(() => {
62+
InfoApi.GetInfo(request);
63+
});
64+
Assert.AreEqual("Specified file not found", ex.Message);
65+
}
66+
3367
[TestCase(@"cells\one-page.xlsx")]
3468
[TestCase(@"diagram\one-page.vsd")]
3569
[TestCase(@"email\one-page.emlx")]

src/GroupDocs.Annotation.Cloud.Sdk.Test/Api/Internal/TestFiles.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public static class TestFiles
8383

8484
#endregion
8585

86+
public static readonly TestFile NotExist = new TestFile("NotExist.docx", "some-folder/");
87+
8688
public static IEnumerable<TestFile> TestFilesList
8789
{
8890
get

src/GroupDocs.Annotation.Cloud.Sdk/Client/RequestHandlers/ApiExceptionRequestHandler.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,23 @@ private void ThrowApiException(HttpWebResponse webResponse, Stream resultStream)
7777
{
7878
var responseData = responseReader.ReadToEnd();
7979

80-
var authErrorResponse = SerializationHelper
81-
.Deserialize(responseData, typeof(AuthErrorResponse)) as AuthErrorResponse;
82-
if (authErrorResponse != null && authErrorResponse.ErrorMessage != null)
80+
if (SerializationHelper
81+
.Deserialize(responseData, typeof(AuthErrorResponse)) is AuthErrorResponse authErrorResponse && authErrorResponse.ErrorMessage != null)
8382
{
8483
throw new ApiException(statusCode, authErrorResponse.ErrorMessage);
8584
}
86-
87-
var apiErrorResponse = SerializationHelper
88-
.Deserialize(responseData, typeof(ApiErrorResponse)) as ApiErrorResponse;
89-
if (apiErrorResponse != null)
85+
86+
if (SerializationHelper
87+
.Deserialize(responseData, typeof(ApiErrorResponse)) is ApiErrorResponse apiErrorResponse && apiErrorResponse.Error != null)
9088
{
9189
throw new ApiException(statusCode, apiErrorResponse.Error.Message);
9290
}
91+
92+
if (SerializationHelper
93+
.Deserialize(responseData, typeof(Error)) is Error apiError)
94+
{
95+
throw new ApiException(statusCode, apiError.Message);
96+
}
9397
}
9498

9599
throw new ApiException(statusCode, webResponse.StatusDescription);

src/GroupDocs.Annotation.Cloud.Sdk/GroupDocs.Annotation.Cloud.Sdk.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net20</TargetFrameworks>
5-
<AssemblyVersion>21.2.0.0</AssemblyVersion>
6-
<FileVersion>21.2.0.0</FileVersion>
7-
<Version>21.2</Version>
5+
<AssemblyVersion>21.6.0.0</AssemblyVersion>
6+
<FileVersion>21.6.0.0</FileVersion>
7+
<Version>21.6</Version>
88
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
99
<Company>GroupDocs</Company>
1010
<Authors>GroupDocs Product Team</Authors>

src/GroupDocs.Annotation.Cloud.Sdk/GroupDocs.Annotation.Cloud.Sdk.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GroupDocs.Annotation.Cloud.Sdk/Model/AnnotateOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public class AnnotateOptions
6868
/// </summary>
6969
public string OutputPath { get; set; }
7070

71+
/// <summary>
72+
/// The path to directory containing custom fonts in storage
73+
/// </summary>
74+
public string FontsPath { get; set; }
75+
7176
/// <summary>
7277
/// Get the string presentation of the object
7378
/// </summary>
@@ -82,6 +87,7 @@ public override string ToString()
8287
sb.Append(" LastPage: ").Append(this.LastPage).Append("\n");
8388
sb.Append(" OnlyAnnotatedPages: ").Append(this.OnlyAnnotatedPages).Append("\n");
8489
sb.Append(" OutputPath: ").Append(this.OutputPath).Append("\n");
90+
sb.Append(" FontsPath: ").Append(this.FontsPath).Append("\n");
8591
sb.Append("}\n");
8692
return sb.ToString();
8793
}

src/GroupDocs.Annotation.Cloud.Sdk/Model/AnnotationInfo.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ public enum PenStyleEnum
350350
/// </summary>
351351
public double? Angle { get; set; }
352352

353+
/// <summary>
354+
/// Gets or sets z-index. Default value is 0 The z-index property specifies the stack order of an element.
355+
/// </summary>
356+
public int? ZIndex { get; set; }
357+
353358
/// <summary>
354359
/// Gets or sets annotation link url
355360
/// </summary>
@@ -393,6 +398,7 @@ public override string ToString()
393398
sb.Append(" FontSize: ").Append(this.FontSize).Append("\n");
394399
sb.Append(" Opacity: ").Append(this.Opacity).Append("\n");
395400
sb.Append(" Angle: ").Append(this.Angle).Append("\n");
401+
sb.Append(" ZIndex: ").Append(this.ZIndex).Append("\n");
396402
sb.Append(" Url: ").Append(this.Url).Append("\n");
397403
sb.Append(" ImagePath: ").Append(this.ImagePath).Append("\n");
398404
sb.Append("}\n");

src/GroupDocs.Annotation.Cloud.Sdk/Model/PreviewOptions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,26 @@ public enum FormatEnum
8686
/// </summary>
8787
public int? Height { get; set; }
8888

89+
/// <summary>
90+
/// Gets or sets the resolution for generated images, in dots per inch. The default value is 96.
91+
/// </summary>
92+
public int? Resolution { get; set; }
93+
8994
/// <summary>
9095
/// Render document comments. Default value is 'false'.
9196
/// </summary>
9297
public bool? RenderComments { get; set; }
9398

99+
/// <summary>
100+
/// The property that controls whether annotations will be generated on the preview. Default State - true.
101+
/// </summary>
102+
public bool? RenderAnnotations { get; set; }
103+
104+
/// <summary>
105+
/// The path to directory containing custom fonts in storage
106+
/// </summary>
107+
public string FontsPath { get; set; }
108+
94109
/// <summary>
95110
/// Get the string presentation of the object
96111
/// </summary>
@@ -104,7 +119,10 @@ public override string ToString()
104119
sb.Append(" PageNumbers: ").Append(this.PageNumbers).Append("\n");
105120
sb.Append(" Width: ").Append(this.Width).Append("\n");
106121
sb.Append(" Height: ").Append(this.Height).Append("\n");
122+
sb.Append(" Resolution: ").Append(this.Resolution).Append("\n");
107123
sb.Append(" RenderComments: ").Append(this.RenderComments).Append("\n");
124+
sb.Append(" RenderAnnotations: ").Append(this.RenderAnnotations).Append("\n");
125+
sb.Append(" FontsPath: ").Append(this.FontsPath).Append("\n");
108126
sb.Append("}\n");
109127
return sb.ToString();
110128
}

src/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-2019 Aspose Pty Ltd
3+
Copyright (c) 2003-2021 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

0 commit comments

Comments
 (0)