Skip to content

Commit 684e8f1

Browse files
authored
Merge pull request #64 from aspose-pdf-cloud/develop
Develop
2 parents 1fd4250 + 186eddf commit 684e8f1

File tree

10 files changed

+38
-40
lines changed

10 files changed

+38
-40
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,9 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
3030
## Read PDF Formats
3131
MHT, PCL, PS, XSLFO, MD
3232

33-
## Enhancements in Version 22.3
34-
- PDFCLOUD-2729: Add Strikeout, Superscript, Subscript properties to TextState.
35-
- PDFCLOUD-2623: Underline property is missing in TextState.
33+
## Enhancements in Version 22.4
3634
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3735

38-
## Bugs fixed in Version 22.3
39-
- PDFCLOUD-2714: GetFields API method not extracting PDF form fields.
40-
- PDFCLOUD-2641: PostSplitDocument returns wrong path.
41-
4236
## Unit Tests
4337
Aspose PDF SDK includes a suite of unit tests. These Unit Tests also serves as examples of how to use the Aspose PDF SDK.
4438

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private string _GetServercredsJson() {
5555
}
5656
di = Directory.GetParent(di.FullName);
5757
}
58-
return null;
58+
throw new FileNotFoundException("servercreds.json not found");
5959
}
6060

6161
private Keys _GetKeys() {
@@ -67,12 +67,10 @@ public virtual void SetUp() {
6767
Console.WriteLine(TestContext.CurrentContext.Test.Name);
6868
// To run tests with your own credentials please uncomment following line of code
6969
// this.keys = new Keys { AppKey = "your app key", AppSID = "your app sid" };
70-
if (keys == null) {
70+
if (keys == null)
7171
keys = _GetKeys();
72-
}
73-
if (string.IsNullOrEmpty(keys.AppKey) || string.IsNullOrEmpty(keys.AppSID)) {
72+
if (string.IsNullOrEmpty(keys.AppKey) || string.IsNullOrEmpty(keys.AppSID))
7473
throw new FileNotFoundException("servercreds.json doesn't contain AppSID and/or AppKey");
75-
}
7674
Configuration = new Configuration(keys.AppKey, keys.AppSID, BaseProductUri);
7775
PdfApi = new PdfApi(Configuration);
7876
}

src/Aspose.Pdf.Cloud.Sdk/Client/ApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private RestRequest PrepareRequest(
205205

206206
// add custom header
207207
request.AddHeader(AsposeClientHeaderName, ".net sdk");
208-
request.AddHeader(AsposeClientVersionHeaderName, "22.3.0");
208+
request.AddHeader(AsposeClientVersionHeaderName, "22.4.0");
209209

210210
// add header parameter, if any
211211
foreach(var param in headerParams)

src/Aspose.Pdf.Cloud.Sdk/Client/ApiException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="ApiException.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/Aspose.Pdf.Cloud.Sdk/Client/ApiResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="ApiResponse.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/Aspose.Pdf.Cloud.Sdk/Client/Configuration.cs

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="Configuration.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -50,39 +50,45 @@ public class Configuration
5050
/// <param name="userAgent">HTTP user agent</param>
5151
public Configuration(string apiKey,
5252
string appSid,
53-
String basePath = "https://api.aspose.cloud",
54-
Dictionary<String, String> defaultHeader = null,
53+
string basePath = "https://api.aspose.cloud",
54+
Dictionary<string, string> defaultHeader = null,
5555
string tempFolderPath = null,
5656
string dateTimeFormat = null,
5757
int timeout = 5 * 60 * 1000,
5858
string userAgent = "aspose pdf cloud sdk"
5959
)
6060
{
61-
if (String.IsNullOrEmpty(basePath))
61+
if (string.IsNullOrEmpty(basePath))
6262
throw new ArgumentException("basePath cannot be empty");
63+
if (!_CheckSidKey(appSid, apiKey))
64+
throw new ArgumentException("appSid and apiKey are messed up or have wrong format");
6365

6466
ApiKey = apiKey;
6567
AppSid = appSid;
6668
BasePath = basePath;
67-
6869
UserAgent = userAgent;
69-
7070
if (defaultHeader != null)
7171
DefaultHeader = defaultHeader;
72-
7372
TempFolderPath = tempFolderPath;
7473
DateTimeFormat = dateTimeFormat;
7574
Timeout = timeout;
7675
}
7776

77+
private static bool _CheckSidKey(string appSid, string apiKey)
78+
{
79+
var ssSid = appSid.Split('-');
80+
var ssKey = apiKey.Split('-');
81+
return ssSid.Length == 5 && ssKey.Length == 1;
82+
}
83+
7884
/// <summary>
7985
/// Default creation of exceptions for a given method name and response object
8086
/// </summary>
8187
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
8288
{
8389
int status = (int) response.StatusCode;
84-
if (status >= 400) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.Content), response.Content);
85-
if (status == 0) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage);
90+
if (status >= 400) return new ApiException(status, string.Format("Error calling {0}: {1}", methodName, response.Content), response.Content);
91+
if (status == 0) return new ApiException(status, string.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage);
8692
return null;
8793
};
8894

@@ -107,12 +113,12 @@ public Configuration(string apiKey,
107113
/// </summary>
108114
public string AppSid { get; set; }
109115

110-
private Dictionary<String, String> _defaultHeaderMap = new Dictionary<String, String>();
116+
private Dictionary<string, string> _defaultHeaderMap = new Dictionary<string, string>();
111117

112118
/// <summary>
113119
/// Gets or sets the default header.
114120
/// </summary>
115-
public Dictionary<String, String> DefaultHeader
121+
public Dictionary<string, string> DefaultHeader
116122
{
117123
get { return _defaultHeaderMap; }
118124

@@ -137,20 +143,20 @@ public void AddDefaultHeader(string key, string value)
137143
/// Gets or sets the HTTP user agent.
138144
/// </summary>
139145
/// <value>Http user agent.</value>
140-
public String UserAgent { get; set; }
146+
public string UserAgent { get; set; }
141147

142148
private string _tempFolderPath;
143149

144150
/// <summary>
145151
/// Gets or sets the temporary folder path to store the files downloaded from the server.
146152
/// </summary>
147153
/// <value>Folder path.</value>
148-
public String TempFolderPath
154+
public string TempFolderPath
149155
{
150156
get
151157
{
152158
// default to Path.GetTempPath() if _tempFolderPath is not set
153-
if (String.IsNullOrEmpty(_tempFolderPath))
159+
if (string.IsNullOrEmpty(_tempFolderPath))
154160
{
155161
_tempFolderPath = Path.GetTempPath();
156162
}
@@ -159,7 +165,7 @@ public String TempFolderPath
159165

160166
set
161167
{
162-
if (String.IsNullOrEmpty(value))
168+
if (string.IsNullOrEmpty(value))
163169
{
164170
_tempFolderPath = value;
165171
return;
@@ -189,7 +195,7 @@ public String TempFolderPath
189195
/// No validation is done to ensure that the string you're providing is valid
190196
/// </summary>
191197
/// <value>The DateTimeFormat string</value>
192-
public String DateTimeFormat
198+
public string DateTimeFormat
193199
{
194200
get
195201
{
@@ -213,16 +219,16 @@ public String DateTimeFormat
213219
/// <summary>
214220
/// Returns a string with essential information for debugging.
215221
/// </summary>
216-
public static String ToDebugReport()
222+
public static string ToDebugReport()
217223
{
218-
String report = "C# SDK (Aspose.Pdf.Cloud.Sdk) Debug Report:\n";
224+
string report = "C# SDK (Aspose.Pdf.Cloud.Sdk) Debug Report:\n";
219225
report += " OS: " + Environment.OSVersion + "\n";
220226
report += " .NET Framework Version: " + Assembly
221227
.GetExecutingAssembly()
222228
.GetReferencedAssemblies()
223229
.Where(x => x.Name == "System.Core").First().Version.ToString() + "\n";
224230
report += " Version of the API: 3.0\n";
225-
report += " SDK Package Version: 22.3.0\n";
231+
report += " SDK Package Version: 22.4.0\n";
226232

227233
return report;
228234
}

src/Aspose.Pdf.Cloud.Sdk/Client/ExceptionFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="ExceptionFactory.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/Aspose.Pdf.Cloud.Sdk/Client/IApiAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="IApiAccessor.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/Aspose.Pdf.Cloud.Sdk/Client/SwaggerDateConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright company="Aspose" file="SwaggerDateConverter.cs">
3-
// Copyright (c) 2020 Aspose.PDF Cloud
3+
// Copyright (c) 2022 Aspose.PDF Cloud
44
// </copyright>
55
// <summary>
66
// Permission is hereby granted, free of charge, to any person obtaining a copy

src/Aspose.Pdf.Cloud.Sdk/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Aspose Pty Ltd")]
1111
[assembly: AssemblyProduct("Aspose.PDF Cloud")]
12-
[assembly: AssemblyCopyright("Copyright (c) 2020 Aspose.PDF Cloud")]
12+
[assembly: AssemblyCopyright("Copyright (c) 2022 Aspose.PDF Cloud")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -28,5 +28,5 @@
2828
// You can specify all the values or you can default the Build and Revision Numbers
2929
// by using the '*' as shown below:
3030
// [assembly: AssemblyVersion("1.0.*")]
31-
[assembly: AssemblyVersion("22.3.0")]
32-
[assembly: AssemblyFileVersion("22.3.0")]
31+
[assembly: AssemblyVersion("22.4.0")]
32+
[assembly: AssemblyFileVersion("22.4.0")]

0 commit comments

Comments
 (0)