Skip to content

Commit 7ca707b

Browse files
Updated to version 18.2
1 parent aa4026e commit 7ca707b

25 files changed

+3202
-523
lines changed

.swagger-codegen-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
.gitignore
2828
*.md
2929
docs/*
30-
**/*.nuspec
3130

3231
#Ignere credentials file
3332
src/Settings/servercreds.json
@@ -45,6 +44,7 @@ src/Aspose.Pdf.Cloud.Sdk/Model/StampType.cs
4544
src/Aspose.Pdf.Cloud.Sdk/Model/VerticalAlignment.cs
4645
src/Aspose.Pdf.Cloud.Sdk/Model/WrapMode.cs
4746
src/Aspose.Pdf.Cloud.Sdk/Model/LinkActionType.cs
47+
src/Aspose.Pdf.Cloud.Sdk/Model/SignatureType.cs
4848

4949
#Do not generate tests.
5050
src/Aspose.Pdf.Cloud.Sdk.Test/**

Aspose.Pdf.Cloud.Sdk.sln

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
33
VisualStudioVersion = 15.0.26430.6
44
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspose.Pdf.Cloud.Sdk", "src\Aspose.Pdf.Cloud.Sdk\Aspose.Pdf.Cloud.Sdk.csproj", "{DCC0754A-1463-4491-93CC-FEB42821E2AA}"
6-
EndProject
75
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspose.Pdf.Cloud.Sdk.Test", "src\Aspose.Pdf.Cloud.Sdk.Test\Aspose.Pdf.Cloud.Sdk.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
86
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspose.Pdf.Cloud.Sdk", "src\Aspose.Pdf.Cloud.Sdk\Aspose.Pdf.Cloud.Sdk.csproj", "{EF4CE7EF-DD3C-4654-8B0A-4BF813184EE4}"
8+
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1111
Debug|Any CPU = Debug|Any CPU
1212
Release|Any CPU = Release|Any CPU
1313
EndGlobalSection
1414
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15-
{DCC0754A-1463-4491-93CC-FEB42821E2AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16-
{DCC0754A-1463-4491-93CC-FEB42821E2AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
17-
{DCC0754A-1463-4491-93CC-FEB42821E2AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
18-
{DCC0754A-1463-4491-93CC-FEB42821E2AA}.Release|Any CPU.Build.0 = Release|Any CPU
1915
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2016
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
2117
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
2218
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{EF4CE7EF-DD3C-4654-8B0A-4BF813184EE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{EF4CE7EF-DD3C-4654-8B0A-4BF813184EE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{EF4CE7EF-DD3C-4654-8B0A-4BF813184EE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{EF4CE7EF-DD3C-4654-8B0A-4BF813184EE4}.Release|Any CPU.Build.0 = Release|Any CPU
2323
EndGlobalSection
2424
GlobalSection(SolutionProperties) = preSolution
2525
HideSolutionNode = FALSE

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ OpenAPI spec version: 1.1
8181
<Compile Include="ImagesTests.cs" />
8282
<Compile Include="LinksTests.cs" />
8383
<Compile Include="MergeTests.cs" />
84+
<Compile Include="TextTests.cs" />
85+
<Compile Include="OcrTests.cs" />
8486
<Compile Include="PagesTests.cs" />
8587
<Compile Include="ParagraphsTests.cs" />
8688
<Compile Include="TextItemsTests.cs" />
@@ -93,11 +95,11 @@ OpenAPI spec version: 1.1
9395
<None Include="app.config" />
9496
<None Include="packages.config" />
9597
</ItemGroup>
96-
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
9798
<ItemGroup>
9899
<ProjectReference Include="..\Aspose.Pdf.Cloud.Sdk\Aspose.Pdf.Cloud.Sdk.csproj">
99-
<Project>{B1853033-7014-4AA7-8DEA-6BB6E76EDF8B}</Project>
100+
<Project>{ef4ce7ef-dd3c-4654-8b0a-4bf813184ee4}</Project>
100101
<Name>Aspose.Pdf.Cloud.Sdk</Name>
101102
</ProjectReference>
102103
</ItemGroup>
104+
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
103105
</Project>

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

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

26+
using System.Collections.Generic;
2627
using System.IO;
2728
using System.Net;
2829
using Aspose.Pdf.Cloud.Sdk.Model;
@@ -124,5 +125,29 @@ public void PutCreateDocumentTest()
124125
templateType: "html");
125126
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
126127
}
128+
129+
/// <summary>
130+
/// Test PutCreateDocumentFromImages
131+
/// </summary>
132+
[Test]
133+
public void PutCreateDocumentFromImagesTest()
134+
{
135+
const string image1 = "33539.jpg";
136+
UploadFile(image1, "pdfimages/" + image1);
137+
138+
const string image2 = "44781.jpg";
139+
UploadFile(image2, "pdfimages/" + image2);
140+
141+
const string name = "pdffromimagesinquery.pdf";
142+
143+
var request = new ImagesListRequest(new List<string>
144+
{
145+
Path.Combine(TempFolder, image1),
146+
Path.Combine(TempFolder, image2)
147+
});
148+
149+
var response = PdfApi.PutCreateDocumentFromImages(name, request, false, folder: TempFolder);
150+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
151+
}
127152
}
128153
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System.Net;
2+
using NUnit.Framework;
3+
4+
namespace Aspose.Pdf.Cloud.Sdk.Test
5+
{
6+
/// <summary>
7+
/// Class for testing OCR Api
8+
/// </summary>
9+
[TestFixture]
10+
public class OcrTests : TestsBase
11+
{
12+
/// <summary>
13+
/// Test PutSearchableDocument
14+
/// </summary>
15+
[Test]
16+
public void PutSearchableDocumentTest()
17+
{
18+
const string name = "rusdoc.pdf";
19+
UploadFile(name, name);
20+
21+
var response = PdfApi.PutSearchableDocument(name, folder: TempFolder, lang: "rus,eng");
22+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
23+
}
24+
25+
/// <summary>
26+
/// Test PutSearchableDocument with default lang
27+
/// </summary>
28+
[Test]
29+
public void PutSearchableDocumentWithDefaultLangTest()
30+
{
31+
const string name = "rusdoc.pdf";
32+
UploadFile(name, name);
33+
34+
var response = PdfApi.PutSearchableDocument(name, folder: TempFolder);
35+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
36+
}
37+
}
38+
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ public class SignTests : TestsBase
4646
FormFieldName: "Signature1",
4747
Location: "Ukraine",
4848
Password: "test1234",
49-
Rectangle: new Rectangle2(
49+
Rectangle: new Rectangle(
5050
X: 100,
5151
Y: 100,
5252
Width: 400,
5353
Height: 100),
5454
SignaturePath: Path.Combine(TempFolder, SignatureName),
55-
SignatureType: "PKCS7",
56-
Visible: true);
55+
SignatureType: SignatureType.PKCS7,
56+
Visible: true,
57+
ShowProperties: false);
5758

5859
/// <summary>
5960
/// Test DocumentPostSignDocument

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,41 @@ public void PostPageReplaceTextListTest()
9090
var response = PdfApi.PostPageReplaceTextList(Name, 1, ReplaceListRequest, folder: TempFolder);
9191
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
9292
}
93+
94+
/// <summary>
95+
/// Test PostDocumentTextReplace
96+
/// </summary>
97+
[Test]
98+
public void PostDocumentTextReplaceTest()
99+
{
100+
const string name = "4pages.pdf";
101+
UploadFile(name, name);
102+
103+
var rect = new Rectangle(100, 700, 300, 300);
104+
var textReplace = new TextReplace("Page", "p_a_g_e", false, Rect: rect);
105+
var textReplaceList = new TextReplaceListRequest(new List<TextReplace> { textReplace },
106+
StartIndex: 0, CountReplace: 0);
107+
108+
var response = PdfApi.PostDocumentTextReplace(name, textReplaceList, folder: TempFolder);
109+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
110+
}
111+
112+
/// <summary>
113+
/// Test PostPageTextReplace
114+
/// </summary>
115+
[Test]
116+
public void PostPageTextReplaceTest()
117+
{
118+
const string name = "4pages.pdf";
119+
UploadFile(name, name);
120+
121+
var rect = new Rectangle(100, 700, 300, 300);
122+
var textReplace = new TextReplace("Page", "p_a_g_e", false, Rect: rect);
123+
var textReplaceList = new TextReplaceListRequest(new List<TextReplace> { textReplace },
124+
StartIndex: 0, CountReplace: 0);
125+
126+
var response = PdfApi.PostPageTextReplace(name, 1, textReplaceList, folder: TempFolder);
127+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
128+
}
93129
}
94130
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System.Collections.Generic;
2+
using System.Net;
3+
using NUnit.Framework;
4+
5+
namespace Aspose.Pdf.Cloud.Sdk.Test
6+
{
7+
/// <summary>
8+
/// Class for testing Text Api
9+
/// </summary>
10+
[TestFixture]
11+
public class TextTests : TestsBase
12+
{
13+
/// <summary>
14+
/// Test GetText
15+
/// </summary>
16+
[Test]
17+
public void GetTextTest()
18+
{
19+
const string name = "4pages.pdf";
20+
UploadFile(name, name);
21+
22+
var response = PdfApi.GetText(name, folder: TempFolder, X: 0, Y: 0, width: 0, height: 0);
23+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
24+
}
25+
26+
/// <summary>
27+
/// Test GetPageText
28+
/// </summary>
29+
[Test]
30+
public void GetPageTextTest()
31+
{
32+
const string name = "4pages.pdf";
33+
UploadFile(name, name);
34+
35+
var format = new List<string> { "First Page", "Second Page" };
36+
var response = PdfApi.GetPageText(name, folder: TempFolder, X: 0, Y: 0, width: 0, height: 0,
37+
pageNumber: 1, format: format);
38+
Assert.That(response.Code, Is.EqualTo(HttpStatusCode.OK));
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)